libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 38608820bc40d39f91112e76c61a9329a51bde5b
parent cf99d4b0fbe6ccf81f5040ca0bcb6c597f333b59
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu, 11 Aug 2011 09:40:48 +0000

use non-blocking sockets

Diffstat:
MChangeLog | 4++++
Msrc/daemon/daemon.c | 8+-------
2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Thu Aug 11 11:40:03 CEST 2011 + Changing sockets to be non-blocking as suggested by Eivind Sarto + on the mailinglist. -CG + Mon Jul 25 16:13:15 CEST 2011 Added a logo. -CG diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c @@ -765,7 +765,6 @@ send_param_adapter (struct MHD_Connection *connection, } -#if HTTPS_SUPPORT /** * Set if a socket should use non-blocking IO. * @param fd socket @@ -798,7 +797,6 @@ socket_set_nonblocking (int fd) } #endif } -#endif /** @@ -978,6 +976,7 @@ MHD_add_connection (struct MHD_Daemon *daemon, MHD_set_http_callbacks_ (connection); connection->recv_cls = &recv_param_adapter; connection->send_cls = &send_param_adapter; + socket_set_nonblocking (connection->socket_fd); #if HTTPS_SUPPORT if (0 != (daemon->options & MHD_USE_SSL)) { @@ -988,11 +987,6 @@ MHD_add_connection (struct MHD_Daemon *daemon, gnutls_init (&connection->tls_session, GNUTLS_SERVER); gnutls_priority_set (connection->tls_session, daemon->priority_cache); - if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) - { - /* use non-blocking IO for gnutls */ - socket_set_nonblocking (connection->socket_fd); - } switch (daemon->cred_type) { /* set needed credentials for certificate authentication. */