View Issue Details

IDProjectCategoryView StatusLast Update
0006019libmicrohttpdexternal APIpublic2020-02-13 20:11
Reporterfche Assigned ToChristian Grothoff  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.69 
Target Version0.9.71Fixed in Version0.9.70 
Summary0006019: request api to check whether mhd connection object still live (tcp socket still connected)
DescriptionFor a multithreaded server where the mhd handlers may block & do longwinded work, it could be beneficial to be able to poll or be told that the underlying tcp connection has been broken by a client going away. That way it can abort this work in progress. The closest thing I could find so far is to get the connection fd via MHD_get_connection_info(MHD_CONNECTION_INFO_CONNECTION_FD), switch the fd into nonblocking mode, then do a trial recv(MSG_PEEK) against it, then restore previous state. If this logic is plausible, it may be useful enough to put it into the api proper.
TagsNo tags attached.

Activities

Christian Grothoff

2020-02-07 14:18

manager   ~0015311

Eh, why would you switch the FD to non-blocking? All sockets that MHD uses should always already be non-blocking.
Other than that, the reason why we have a way for you to get to the socket is to allow you to do such things, so the API already exists. Not sure what we should change here...

fche

2020-02-07 14:21

reporter   ~0015312

"All sockets that MHD uses should always already be non-blocking."

OK, if this is a guarantee, that's great. Is that in the documentation somewhere?

Christian Grothoff

2020-02-09 23:45

manager   ~0015325

I've added a comment to that effect in fe6716d1..902e3774. Resolving this issue.

Issue History

Date Modified Username Field Change
2019-12-28 18:39 fche New Issue
2020-02-07 14:18 Christian Grothoff Note Added: 0015311
2020-02-07 14:18 Christian Grothoff Assigned To => Christian Grothoff
2020-02-07 14:18 Christian Grothoff Status new => feedback
2020-02-07 14:21 fche Note Added: 0015312
2020-02-07 14:21 fche Status feedback => assigned
2020-02-07 14:23 Christian Grothoff Assigned To Christian Grothoff =>
2020-02-07 14:23 Christian Grothoff Status assigned => feedback
2020-02-09 23:45 Christian Grothoff Note Added: 0015325
2020-02-09 23:45 Christian Grothoff Assigned To => Christian Grothoff
2020-02-09 23:45 Christian Grothoff Status feedback => resolved
2020-02-09 23:45 Christian Grothoff Resolution open => fixed
2020-02-09 23:45 Christian Grothoff Fixed in Version => 0.9.71
2020-02-09 23:45 Christian Grothoff Target Version => 0.9.71
2020-02-13 20:11 Christian Grothoff Status resolved => closed
2020-02-13 20:11 Christian Grothoff Fixed in Version 0.9.71 => 0.9.70
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API