View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005278 | libmicrohttpd | internal event loop | public | 2018-02-14 21:24 | 2018-11-06 19:46 |
| Reporter | texec | Assigned To | Christian Grothoff | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 0.9.59 | ||||
| Target Version | 0.9.60 | Fixed in Version | 0.9.60 | ||
| Summary | 0005278: Long running connections are aborted due to incomplete logic change | ||||
| Description | Commit d9b6e400 added fd_set es to thread_main_handle_connection in daemon.c. Later in the case MHD_EVENT_LOOP_INFO_BLOCK the socket is added to &es via add_tod_fd_set. Previously it was added to &rs. Then in line 1621 (d9b6e400) the following code is left unchanged: num_ready = MHD_SYS_select_ (maxsock + 1, &rs, &ws, NULL, tvp); In 1654 FD_ISSET(…, &es) is passed as force_close argument to call_handlers. As &es is not cleared by the select call it's still set and the connection is always closed. In our experience this leads to a closed connection 1-5 seconds after we sent our last data. Due to this delay/timeout the issue may not have been detected previously. Using &es as argument to SYS_select_ instead of NULL fixes the problem for us. | ||||
| Additional Information | d9b6e400 was released with 0.9.53. (Current master (48dd53c7eb, gnunet) does not build on macOS, as the definition of MHD_socket_create_listen_ in mhd_sockets.h seems to be wrong (the function is called with a socket descriptor, not a boolean argument)) | ||||
| Tags | No tags attached. | ||||
| Attached Files | issue-select-master.diff (524 bytes)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 639add58..141c89d4 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1937,7 +1937,7 @@ thread_main_handle_connection (void *data)
num_ready = MHD_SYS_select_ (maxsock + 1,
&rs,
&ws,
- NULL,
+ &es,
tvp);
if (num_ready < 0)
{
| ||||
| has duplicate | 0005295 | closed | Christian Grothoff | connection forcibly closed when response reader returns no data |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2018-02-14 21:24 | texec | New Issue | |
| 2018-02-14 21:24 | texec | File Added: issue-select-master.diff | |
| 2018-02-16 05:03 | Christian Grothoff | Assigned To | => Christian Grothoff |
| 2018-02-16 05:03 | Christian Grothoff | Status | new => resolved |
| 2018-02-16 05:03 | Christian Grothoff | Resolution | open => fixed |
| 2018-02-16 05:03 | Christian Grothoff | Fixed in Version | => 0.9.60 |
| 2018-02-16 05:03 | Christian Grothoff | Note Added: 0012860 | |
| 2018-02-16 05:03 | Christian Grothoff | Target Version | => 0.9.60 |
| 2018-03-23 22:22 | Christian Grothoff | Relationship added | has duplicate 0005295 |
| 2018-11-06 19:46 | Christian Grothoff | Status | resolved => closed |
| 2024-01-21 13:24 | Christian Grothoff | Category | libmicrohttpd internal select => internal event loop |