diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-09-26 14:04:37 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-09-26 14:04:37 +0200 |
commit | f69ca10dd01da206a174730f8f923d3d3bd61492 (patch) | |
tree | 404fd6247df840b939a0a02bd3b08d70402f70d7 | |
parent | 697b4af5fc205ffa6ed517756f5806ad56c2734f (diff) | |
download | libmicrohttpd-f69ca10dd01da206a174730f8f923d3d3bd61492.tar.gz libmicrohttpd-f69ca10dd01da206a174730f8f923d3d3bd61492.zip |
Fix at-limit race
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 2 |
2 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,6 @@ | |||
1 | Tue Sep 26 14:00:58 CEST 2017 | ||
2 | Fixing race involving setting "at_limit" flag. -CG | ||
3 | |||
1 | Tue Sep 08 21:39:00 MSK 2017 | 4 | Tue Sep 08 21:39:00 MSK 2017 |
2 | Fixed build of examples when MHD build with non-pthread lib. | 5 | Fixed build of examples when MHD build with non-pthread lib. |
3 | MHD_queue_response(): added check for using in correct thread. | 6 | MHD_queue_response(): added check for using in correct thread. |
@@ -19,7 +22,7 @@ Tue Jun 20 23:52:00 MSK 2017 | |||
19 | Libgcrypt is now optional and required only for old GnuTLS versions. -EG | 22 | Libgcrypt is now optional and required only for old GnuTLS versions. -EG |
20 | 23 | ||
21 | Wed Jun 14 21:42:00 MSK 2017 | 24 | Wed Jun 14 21:42:00 MSK 2017 |
22 | Added support for debug assert() and new configure parameter | 25 | Added support for debug assert() and new configure parameter |
23 | --enable-asserts for debug builds. | 26 | --enable-asserts for debug builds. |
24 | Removed non-functional Symbian support. -EG | 27 | Removed non-functional Symbian support. -EG |
25 | 28 | ||
@@ -37,7 +40,7 @@ Mon Jun 05 23:34:00 MSK 2017 | |||
37 | Mon Jun 05 22:20:00 MSK 2017 | 40 | Mon Jun 05 22:20:00 MSK 2017 |
38 | Internal refactoring: | 41 | Internal refactoring: |
39 | used TCP sockets directly with GnuTLS (performance improvement), | 42 | used TCP sockets directly with GnuTLS (performance improvement), |
40 | moved some connection-related code from daemon.c to | 43 | moved some connection-related code from daemon.c to |
41 | connection.c/connection_https.c, | 44 | connection.c/connection_https.c, |
42 | removed hacks around sendfile() and implemented correct support of | 45 | removed hacks around sendfile() and implemented correct support of |
43 | sendfile(), | 46 | sendfile(), |
@@ -82,7 +85,7 @@ Thu May 11 14:24:00 MSK 2017 | |||
82 | Do not add any "Connection" headers for "upgrade" connections. -EG | 85 | Do not add any "Connection" headers for "upgrade" connections. -EG |
83 | 86 | ||
84 | Wed May 10 23:09:00 MSK 2017 | 87 | Wed May 10 23:09:00 MSK 2017 |
85 | Resume resuming connection before other processing in external polling | 88 | Resume resuming connection before other processing in external polling |
86 | mode. -EG | 89 | mode. -EG |
87 | 90 | ||
88 | Tue May 9 23:16:00 MSK 2017 | 91 | Tue May 9 23:16:00 MSK 2017 |
@@ -103,7 +106,7 @@ Mon May 8 19:30:00 MSK 2017 | |||
103 | MHD_get_response_header(), match only headers (not footers). -EG | 106 | MHD_get_response_header(), match only headers (not footers). -EG |
104 | 107 | ||
105 | Fri May 5 20:57:00 MSK 2017 | 108 | Fri May 5 20:57:00 MSK 2017 |
106 | Fixed null dereference when connection has "Upgrade" request and | 109 | Fixed null dereference when connection has "Upgrade" request and |
107 | connection is not upgraded. -JB/EG | 110 | connection is not upgraded. -JB/EG |
108 | Better handle Keep-Alive/Close. -EG | 111 | Better handle Keep-Alive/Close. -EG |
109 | 112 | ||
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 18bfc7a8..fb363caa 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2910,7 +2910,9 @@ MHD_accept_connection (struct MHD_Daemon *daemon) | |||
2910 | } | 2910 | } |
2911 | else | 2911 | else |
2912 | { | 2912 | { |
2913 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | ||
2913 | daemon->at_limit = true; | 2914 | daemon->at_limit = true; |
2915 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | ||
2914 | #ifdef HAVE_MESSAGES | 2916 | #ifdef HAVE_MESSAGES |
2915 | MHD_DLOG (daemon, | 2917 | MHD_DLOG (daemon, |
2916 | _("Hit process or system resource limit at %u connections, temporarily suspending accept(). Consider setting a lower MHD_OPTION_CONNECTION_LIMIT.\n"), | 2918 | _("Hit process or system resource limit at %u connections, temporarily suspending accept(). Consider setting a lower MHD_OPTION_CONNECTION_LIMIT.\n"), |