diff options
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r-- | src/daemon/daemon.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index e5317c04..b7c66c8d 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -44,7 +44,13 @@ | |||
44 | * Print extra messages with reasons for closing | 44 | * Print extra messages with reasons for closing |
45 | * sockets? (only adds non-error messages). | 45 | * sockets? (only adds non-error messages). |
46 | */ | 46 | */ |
47 | #define DEBUG_CLOSE 0 | 47 | #define DEBUG_CLOSE MHD_NO |
48 | |||
49 | /** | ||
50 | * Print extra messages when establishing | ||
51 | * connections? (only adds non-error messages). | ||
52 | */ | ||
53 | #define DEBUG_CONNECT MHD_NO | ||
48 | 54 | ||
49 | /** | 55 | /** |
50 | * Register an access handler for all URIs beginning with uri_prefix. | 56 | * Register an access handler for all URIs beginning with uri_prefix. |
@@ -163,6 +169,9 @@ MHD_get_fdset (struct MHD_Daemon *daemon, | |||
163 | return MHD_NO; | 169 | return MHD_NO; |
164 | pos = pos->next; | 170 | pos = pos->next; |
165 | } | 171 | } |
172 | #if DEBUG_CONNECT | ||
173 | MHD_DLOG (daemon, "Maximum socket in select set: %d\n", *max_fd); | ||
174 | #endif | ||
166 | return MHD_YES; | 175 | return MHD_YES; |
167 | } | 176 | } |
168 | 177 | ||
@@ -276,6 +285,9 @@ MHD_accept_connection (struct MHD_Daemon *daemon) | |||
276 | } | 285 | } |
277 | return MHD_NO; | 286 | return MHD_NO; |
278 | } | 287 | } |
288 | #if DEBUG_CONNECT | ||
289 | MHD_DLOG (daemon, "Accepted connection on socket %d\n", s); | ||
290 | #endif | ||
279 | if (daemon->max_connections == 0) | 291 | if (daemon->max_connections == 0) |
280 | { | 292 | { |
281 | /* above connection limit - reject */ | 293 | /* above connection limit - reject */ |
@@ -425,7 +437,8 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) | |||
425 | continue; | 437 | continue; |
426 | } | 438 | } |
427 | 439 | ||
428 | if ((pos->headersReceived == MHD_YES) && (pos->response == NULL)) | 440 | if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && |
441 | ((pos->headersReceived == MHD_YES) && (pos->response == NULL)) ) | ||
429 | MHD_call_connection_handler (pos); | 442 | MHD_call_connection_handler (pos); |
430 | 443 | ||
431 | prev = pos; | 444 | prev = pos; |