summaryrefslogtreecommitdiff
path: root/libmailutils/server/ipsrv.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-05-25 14:52:16 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2013-05-25 14:52:16 +0300
commitb0769798ab5dc2daaca5559289eac6714554568b (patch)
treef34660f6fcef5a2b6240a6fd7044ec1b6e2cd476 /libmailutils/server/ipsrv.c
parent43d9797eef76ba39c987f227d8ac44983ce201e4 (diff)
downloadmailutils-b0769798ab5dc2daaca5559289eac6714554568b.tar.gz
mailutils-b0769798ab5dc2daaca5559289eac6714554568b.tar.bz2
Bugfixes.
* imap4d/io.c (imap4d_tokbuf_decrlf): Rewrite to run in O(n). * libmailutils/server/ipsrv.c (mu_ip_tcp_accept): Return 0 on EINTR (unless srv->f_intr tells otherwise) and EAGAIN. The caller will retry. (mu_ip_server_accept): output a diagnostic message before returning error.
Diffstat (limited to 'libmailutils/server/ipsrv.c')
-rw-r--r--libmailutils/server/ipsrv.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libmailutils/server/ipsrv.c b/libmailutils/server/ipsrv.c
index fa7086370..9ba9c0fc8 100644
--- a/libmailutils/server/ipsrv.c
+++ b/libmailutils/server/ipsrv.c
@@ -361,10 +361,14 @@ mu_ip_tcp_accept (mu_ip_server_t srv, void *call_data)
if (connfd == -1)
{
int ec = errno;
- if (ec == EINTR)
- {
- if (srv->f_intr && srv->f_intr (srv->data, call_data))
- mu_ip_server_shutdown (srv);
+ switch (ec)
+ {
+ case EINTR:
+ if (srv->f_intr && srv->f_intr (srv->data, call_data))
+ break;
+ /* fall through */
+ case EAGAIN:
+ ec = 0;
}
return ec;
}
@@ -493,7 +497,11 @@ mu_ip_server_accept (mu_ip_server_t srv, void *call_data)
}
if (rc)
- mu_ip_server_shutdown (srv);
+ {
+ mu_error (_("socket error on \"%s\": %s"), IDENTSTR (srv),
+ mu_strerror (rc));
+ mu_ip_server_shutdown (srv);
+ }
return rc;
}

Return to:

Send suggestions and report system problems to the System administrator.