aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-19 21:17:29 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-19 21:17:29 +0000
commitced72bc239834da12bbd5faaf5812967b7c1fcfa (patch)
treedb8b96417324f32435c3386b8f7f401dd89ee493
parentc9320b2dbf64b81848bf40822681480657f1fafc (diff)
downloadlibmicrohttpd-ced72bc239834da12bbd5faaf5812967b7c1fcfa.tar.gz
libmicrohttpd-ced72bc239834da12bbd5faaf5812967b7c1fcfa.zip
hopefully fixing #1967
-rw-r--r--ChangeLog12
-rw-r--r--src/daemon/daemon.c14
2 files changed, 21 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f0b2c69f..bda07055 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
1Thu Jan 19 17:46:05 CET 2012 1Thu Jan 19 22:11:12 CET 2012
2 Fixing use of uninitialized 'earliest_deadline' variable in 2 Switch to non-blocking sockets for all systems but Cygwin
3 (we already used non-blocking sockets for GNU/Linux); also
4 use non-blocking sockets on Cygwin for HTTPS as this is
5 required to avoid DoS-by-partial-record via gnutls. On
6 Cygwin, #1824 implies that we need to use blocking sockets
7 for HTTP on Cygwin for now. -CG
8
9Thu Jan 19 17:46:05 CET 2012
10 Fixing use of uninitialized 'earliest_deadline' variable in
3 MHD_get_timeout which can lead to returning an incorrect 11 MHD_get_timeout which can lead to returning an incorrect
4 (too early) timeout (#2085). -tclaveirole 12 (too early) timeout (#2085). -tclaveirole
5 13
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index e09fdbc9..6b47c1fc 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -944,9 +944,18 @@ MHD_add_connection (struct MHD_Daemon *daemon,
944 MHD_set_http_callbacks_ (connection); 944 MHD_set_http_callbacks_ (connection);
945 connection->recv_cls = &recv_param_adapter; 945 connection->recv_cls = &recv_param_adapter;
946 connection->send_cls = &send_param_adapter; 946 connection->send_cls = &send_param_adapter;
947#if LINUX 947 /* non-blocking sockets are required on most systems and for GNUtls;
948 however, they somehow cause serious problems on CYGWIN (#1824) */
949#ifdef CYGWIN
950 if
951#if HTTPS_SUPPORT
952 (0 != (daemon->options & MHD_USE_SSL))
953#else
954 (0)
955#endif
956#endif
948 { 957 {
949 /* non-blocking sockets perform better on Linux */ 958 /* make socket non-blocking */
950 int flags = fcntl (connection->socket_fd, F_GETFL); 959 int flags = fcntl (connection->socket_fd, F_GETFL);
951 if ( (flags == -1) || 960 if ( (flags == -1) ||
952 (0 != fcntl (connection->socket_fd, F_SETFL, flags | O_NONBLOCK)) ) 961 (0 != fcntl (connection->socket_fd, F_SETFL, flags | O_NONBLOCK)) )
@@ -957,7 +966,6 @@ MHD_add_connection (struct MHD_Daemon *daemon,
957#endif 966#endif
958 } 967 }
959 } 968 }
960#endif
961 969
962#if HTTPS_SUPPORT 970#if HTTPS_SUPPORT
963 if (0 != (daemon->options & MHD_USE_SSL)) 971 if (0 != (daemon->options & MHD_USE_SSL))