diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-27 20:19:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-27 20:19:25 +0000 |
commit | 4d997941e33acfb57d9da7b560a81f94f0051796 (patch) | |
tree | ec1ef47dfd64602edac8ff7e1eb8fe890bbf1072 /src | |
parent | 7eba79ea8607e1498fdc23a7045fe04f79c0daf5 (diff) | |
download | libmicrohttpd-4d997941e33acfb57d9da7b560a81f94f0051796.tar.gz libmicrohttpd-4d997941e33acfb57d9da7b560a81f94f0051796.zip |
fix late counter-decrement issue reported by MD on the mailinglist
Diffstat (limited to 'src')
-rw-r--r-- | src/include/microhttpd.h | 2 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index ad5bc983..6e12fa5e 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -130,7 +130,7 @@ typedef intptr_t ssize_t; | |||
130 | * Current version of the library. | 130 | * Current version of the library. |
131 | * 0x01093001 = 1.9.30-1. | 131 | * 0x01093001 = 1.9.30-1. |
132 | */ | 132 | */ |
133 | #define MHD_VERSION 0x00094205 | 133 | #define MHD_VERSION 0x00094206 |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * MHD-internal return code for "YES". | 136 | * MHD-internal return code for "YES". |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 4613ae32..00a5c114 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1019,7 +1019,7 @@ exit: | |||
1019 | &con->socket_context, | 1019 | &con->socket_context, |
1020 | MHD_CONNECTION_NOTIFY_CLOSED); | 1020 | MHD_CONNECTION_NOTIFY_CLOSED); |
1021 | 1021 | ||
1022 | return (MHD_THRD_RTRN_TYPE_)0; | 1022 | return (MHD_THRD_RTRN_TYPE_) 0; |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | 1025 | ||
@@ -2039,6 +2039,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) | |||
2039 | if (NULL != pos->tls_session) | 2039 | if (NULL != pos->tls_session) |
2040 | gnutls_deinit (pos->tls_session); | 2040 | gnutls_deinit (pos->tls_session); |
2041 | #endif | 2041 | #endif |
2042 | daemon->connections--; | ||
2042 | if (NULL != daemon->notify_connection) | 2043 | if (NULL != daemon->notify_connection) |
2043 | daemon->notify_connection (daemon->notify_connection_cls, | 2044 | daemon->notify_connection (daemon->notify_connection_cls, |
2044 | pos, | 2045 | pos, |
@@ -2087,7 +2088,6 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) | |||
2087 | if (NULL != pos->addr) | 2088 | if (NULL != pos->addr) |
2088 | free (pos->addr); | 2089 | free (pos->addr); |
2089 | free (pos); | 2090 | free (pos); |
2090 | daemon->connections--; | ||
2091 | } | 2091 | } |
2092 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && | 2092 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && |
2093 | (MHD_YES != MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) ) | 2093 | (MHD_YES != MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) ) |