View Issue Details

IDProjectCategoryView StatusLast Update
0007196libmicrohttpdexternal APIpublic2024-01-21 13:33
Reporterbasch Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.75 
Fixed in Version0.9.76 
Summary0007196: mhd_assert(0) after MHD_resume_connection()
DescriptionHello,

I think I've stumbled over a minor bug in MHD.

If a connection is suspended in the response-callback (MHD_suspend_connection() and return 0) and resumed at some later point through MHD_resume_connection(), this is what happens:

* connection has event_loop_info=MHD_EVENT_LOOP_INFO_WRITE and
  state=MHD_CONNECTION_NORMAL_BODY_UNREADY/MHD_CONNECTION_CHUNKED_BODY_UNREADY
* daemon.c:call_handlers() -> connection.c:MHD_connection_handle_write() -> switch(state) -> assert(0)

Thanks and regards!
TagsNo tags attached.

Activities

Christian Grothoff

2023-02-08 14:29

manager   ~0019776

The problem here is that you MUST NOT return '0' from the access handler callback after suspending the connection.
a7c91385..4627d005 documents this more clearly and adds an assertion which will trigger earlier (upon returning the invalid MHD_NO from the access handler).

Issue History

Date Modified Username Field Change
2022-03-17 21:18 basch New Issue
2023-02-08 14:29 Christian Grothoff Note Added: 0019776
2023-02-08 14:29 Christian Grothoff Assigned To => Christian Grothoff
2023-02-08 14:29 Christian Grothoff Status new => resolved
2023-02-08 14:29 Christian Grothoff Resolution open => fixed
2023-02-08 14:29 Christian Grothoff Fixed in Version => 0.9.76
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API
2024-01-21 13:33 Christian Grothoff Status resolved => closed