From: Christian Grothoff Date: Sat, 28 Feb 2015 15:56:19 +0000 (+0000) Subject: ignore EAGAIN from accept() X-Git-Tag: initial-import-from-subversion-38251~2268 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2c2a6b688d158dcc8638bb431b6669894b8b780e;p=oweals%2Fgnunet.git ignore EAGAIN from accept() --- diff --git a/src/util/connection.c b/src/util/connection.c index 8560f52af..cd3ebad61 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -342,7 +342,8 @@ GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb, GNUNET_NETWORK_socket_accept (lsock, (struct sockaddr *) &addr, &addrlen); if (NULL == sock) { - LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "accept"); + if (EAGAIN != errno) + LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "accept"); return NULL; } if ((addrlen > sizeof (addr)) || (addrlen < sizeof (sa_family_t))) diff --git a/src/util/server.c b/src/util/server.c index 32ef22efd..920d4ab33 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -406,10 +406,10 @@ process_listen_socket (void *cls, GNUNET_SERVER_resume (server); return; } - i = 0; - while (NULL != server->listen_sockets[i]) + for (i = 0; NULL != server->listen_sockets[i]; i++) { - if (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_sockets[i])) + if (GNUNET_NETWORK_fdset_isset (tc->read_ready, + server->listen_sockets[i])) { sock = GNUNET_CONNECTION_create_from_accept (server->access_cb, @@ -423,7 +423,6 @@ process_listen_socket (void *cls, sock); } } - i++; } /* listen for more! */ GNUNET_SERVER_resume (server);