View Issue Details

IDProjectCategoryView StatusLast Update
0007196libmicrohttpdexternal APIpublic2024-01-21 12:33
Reporterbasch Assigned ToChristian Grothoff Due Date
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 13: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 ModifiedUsernameFieldChange
2022-03-17 20:18baschNew Issue
2023-02-08 13:29Christian GrothoffNote Added: 0019776
2023-02-08 13:29Christian GrothoffAssigned To => Christian Grothoff
2023-02-08 13:29Christian GrothoffStatusnew => resolved
2023-02-08 13:29Christian GrothoffResolutionopen => fixed
2023-02-08 13:29Christian GrothoffFixed in Version => 0.9.76
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API
2024-01-21 12:33Christian GrothoffStatusresolved => closed