diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/microhttpd/daemon.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 5af6bd60..2173378d 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1824,6 +1824,14 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
1824 | if (MHD_NO != daemon->resuming) | 1824 | if (MHD_NO != daemon->resuming) |
1825 | next = daemon->suspended_connections_head; | 1825 | next = daemon->suspended_connections_head; |
1826 | 1826 | ||
1827 | /* Clear the flag *only* if connections will be resumed otherwise | ||
1828 | it may accidentally clear flag that was set at the same time in | ||
1829 | other thread (just after 'if (MHD_NO != daemon->resuming)' in | ||
1830 | this thread). | ||
1831 | Clear flag *before* resuming connections otherwise new connection can | ||
1832 | be set to "resuming" in other thread, but missed resuming in this | ||
1833 | function at this time so clearing flag at end will clear it without | ||
1834 | actually resuming of new connection. */ | ||
1827 | if (NULL != next) | 1835 | if (NULL != next) |
1828 | daemon->resuming = MHD_NO; | 1836 | daemon->resuming = MHD_NO; |
1829 | while (NULL != (pos = next)) | 1837 | while (NULL != (pos = next)) |