Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
c754bb7e
...
c754bb7ef1c0a668f8c672aaae9a5de16e68a355
authored
2002-05-11 01:17:29 +0000
by
Sam Roberts
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
tcp_stream_create now has more informative errors for no host or port
1 parent
108f892c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
include/mailutils/errno.h
mailbox/muerrno.c
mailbox/tcp.c
include/mailutils/errno.h
View file @
c754bb7
...
...
@@ -60,6 +60,9 @@ extern "C" {
#define MU_ERR_MAILER_NO_RCPT_TO (MU_ERR_BASE | 0x015)
#define MU_ERR_SMTP_RCPT_FAILED (MU_ERR_BASE | 0x016)
#define MU_ERR_TCP_NO_HOST (MU_ERR_BASE | 0x017)
#define MU_ERR_TCP_NO_PORT (MU_ERR_BASE | 0x018)
const
char
*
mu_errname
__P
((
int
e
));
const
char
*
mu_errstring
__P
((
int
e
));
...
...
mailbox/muerrno.c
View file @
c754bb7
...
...
@@ -64,13 +64,16 @@ mu_errname (int e)
EN
(
MU_ERR_LOCK_EXT_FAIL
)
EN
(
MU_ERR_LOCK_EXT_ERR
)
EN
(
MU_ERR_LOCK_EXT_KILLED
)
EN
(
MU_ERR_NO_SUCH_USER
)
EN
(
MU_ERR_GETHOSTBYNAME
)
EN
(
MU_ERR_BAD_RESUMPTION
)
EN
(
MU_ERR_MAILER_BAD_FROM
)
EN
(
MU_ERR_MAILER_BAD_TO
)
EN
(
MU_ERR_MAILER_NO_RCPT_TO
)
EN
(
MU_ERR_SMTP_RCPT_FAILED
)
EN
(
MU_ERR_NO_SUCH_USER
)
EN
(
MU_ERR_GETHOSTBYNAME
)
EN
(
MU_ERR_BAD_RESUMPTION
)
EN
(
MU_ERR_MAILER_BAD_FROM
)
EN
(
MU_ERR_MAILER_BAD_TO
)
EN
(
MU_ERR_MAILER_NO_RCPT_TO
)
EN
(
MU_ERR_SMTP_RCPT_FAILED
)
EN
(
MU_ERR_TCP_NO_HOST
)
EN
(
MU_ERR_TCP_NO_PORT
)
}
return
"SYSTEM ERROR"
;
...
...
@@ -105,12 +108,14 @@ const char* mu_errstring (int e)
ES
(
MU_ERR_NO_SUCH_USER
,
"No such user name"
)
ES
(
MU_ERR_GETHOSTBYNAME
,
"
gethostbyname() failed, check h_errno
"
)
ES
(
MU_ERR_GETHOSTBYNAME
,
"
DNS name resolution failed
"
)
ES
(
MU_ERR_BAD_RESUMPTION
,
"State busy, must resume operation"
)
ES
(
MU_ERR_MAILER_BAD_FROM
,
"Not a valid mailer from address"
)
ES
(
MU_ERR_MAILER_BAD_TO
,
"Not a valid mailer to address"
)
ES
(
MU_ERR_MAILER_NO_RCPT_TO
,
"No receipt addresses found"
)
ES
(
MU_ERR_SMTP_RCPT_FAILED
,
"SMTP rcpt to command failed"
)
ES
(
MU_ERR_TCP_NO_HOST
,
"Tcp connections need a host"
)
ES
(
MU_ERR_TCP_NO_PORT
,
"Tcp connections need a postive port"
)
}
return
strerror
(
e
);
...
...
mailbox/tcp.c
View file @
c754bb7
...
...
@@ -232,8 +232,11 @@ tcp_stream_create (stream_t * stream, const char* host, int port, int flags)
struct
_tcp_instance
*
tcp
;
int
ret
;
if
(
host
==
NULL
||
port
<
1
)
return
EINVAL
;
if
(
host
==
NULL
)
return
MU_ERR_TCP_NO_HOST
if
(
port
<
1
)
return
MU_ERR_TCP_NO_PORT
;
if
((
tcp
=
malloc
(
sizeof
(
*
tcp
)))
==
NULL
)
return
ENOMEM
;
...
...
Please
register
or
sign in
to post a comment