diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-11 09:40:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-11 09:40:48 +0000 |
commit | 38608820bc40d39f91112e76c61a9329a51bde5b (patch) | |
tree | 7ff691f28ae2588ab3cfe4b2ad2b3828bbdad0a0 | |
parent | cf99d4b0fbe6ccf81f5040ca0bcb6c597f333b59 (diff) | |
download | libmicrohttpd-38608820bc40d39f91112e76c61a9329a51bde5b.tar.gz libmicrohttpd-38608820bc40d39f91112e76c61a9329a51bde5b.zip |
use non-blocking sockets
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/daemon/daemon.c | 8 |
2 files changed, 5 insertions, 7 deletions
@@ -1,3 +1,7 @@ | |||
1 | Thu Aug 11 11:40:03 CEST 2011 | ||
2 | Changing sockets to be non-blocking as suggested by Eivind Sarto | ||
3 | on the mailinglist. -CG | ||
4 | |||
1 | Mon Jul 25 16:13:15 CEST 2011 | 5 | Mon Jul 25 16:13:15 CEST 2011 |
2 | Added a logo. -CG | 6 | Added a logo. -CG |
3 | 7 | ||
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 4b9049d1..ced8a64c 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -765,7 +765,6 @@ send_param_adapter (struct MHD_Connection *connection, | |||
765 | } | 765 | } |
766 | 766 | ||
767 | 767 | ||
768 | #if HTTPS_SUPPORT | ||
769 | /** | 768 | /** |
770 | * Set if a socket should use non-blocking IO. | 769 | * Set if a socket should use non-blocking IO. |
771 | * @param fd socket | 770 | * @param fd socket |
@@ -798,7 +797,6 @@ socket_set_nonblocking (int fd) | |||
798 | } | 797 | } |
799 | #endif | 798 | #endif |
800 | } | 799 | } |
801 | #endif | ||
802 | 800 | ||
803 | 801 | ||
804 | /** | 802 | /** |
@@ -978,6 +976,7 @@ MHD_add_connection (struct MHD_Daemon *daemon, | |||
978 | MHD_set_http_callbacks_ (connection); | 976 | MHD_set_http_callbacks_ (connection); |
979 | connection->recv_cls = &recv_param_adapter; | 977 | connection->recv_cls = &recv_param_adapter; |
980 | connection->send_cls = &send_param_adapter; | 978 | connection->send_cls = &send_param_adapter; |
979 | socket_set_nonblocking (connection->socket_fd); | ||
981 | #if HTTPS_SUPPORT | 980 | #if HTTPS_SUPPORT |
982 | if (0 != (daemon->options & MHD_USE_SSL)) | 981 | if (0 != (daemon->options & MHD_USE_SSL)) |
983 | { | 982 | { |
@@ -988,11 +987,6 @@ MHD_add_connection (struct MHD_Daemon *daemon, | |||
988 | gnutls_init (&connection->tls_session, GNUTLS_SERVER); | 987 | gnutls_init (&connection->tls_session, GNUTLS_SERVER); |
989 | gnutls_priority_set (connection->tls_session, | 988 | gnutls_priority_set (connection->tls_session, |
990 | daemon->priority_cache); | 989 | daemon->priority_cache); |
991 | if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) | ||
992 | { | ||
993 | /* use non-blocking IO for gnutls */ | ||
994 | socket_set_nonblocking (connection->socket_fd); | ||
995 | } | ||
996 | switch (daemon->cred_type) | 990 | switch (daemon->cred_type) |
997 | { | 991 | { |
998 | /* set needed credentials for certificate authentication. */ | 992 | /* set needed credentials for certificate authentication. */ |