View Issue Details

IDProjectCategoryView StatusLast Update
0006019libmicrohttpdexternal APIpublic2020-02-13 19:11
Reporterfche Assigned ToChristian Grothoff Due Date
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 13: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 13: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 22:45

manager   ~0015325

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

Issue History

Date ModifiedUsernameFieldChange
2019-12-28 17:39fcheNew Issue
2020-02-07 13:18Christian GrothoffNote Added: 0015311
2020-02-07 13:18Christian GrothoffAssigned To => Christian Grothoff
2020-02-07 13:18Christian GrothoffStatusnew => feedback
2020-02-07 13:21fcheNote Added: 0015312
2020-02-07 13:21fcheStatusfeedback => assigned
2020-02-07 13:23Christian GrothoffAssigned ToChristian Grothoff =>
2020-02-07 13:23Christian GrothoffStatusassigned => feedback
2020-02-09 22:45Christian GrothoffNote Added: 0015325
2020-02-09 22:45Christian GrothoffAssigned To => Christian Grothoff
2020-02-09 22:45Christian GrothoffStatusfeedback => resolved
2020-02-09 22:45Christian GrothoffResolutionopen => fixed
2020-02-09 22:45Christian GrothoffFixed in Version => 0.9.71
2020-02-09 22:45Christian GrothoffTarget Version => 0.9.71
2020-02-13 19:11Christian GrothoffStatusresolved => closed
2020-02-13 19:11Christian GrothoffFixed in Version0.9.71 => 0.9.70
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API