View Issue Details

IDProjectCategoryView StatusLast Update
0002783libmicrohttpdHTTP GET/HEADpublic2021-09-02 15:54
Reporterklx.login Assigned ToChristian Grothoff Due Date
PriorityhighSeverityblockReproducibilityalways
Status closedResolutionfixed 
Platformi386OSubuntuOS Version10.04
Product Version0.9.24 
Target Version0.9.25Fixed in Version0.9.25 
Summary0002783: when create a no body MHD_Response, and response by https, goes into an infinite loop
Descriptionwhen create a no body MHD_Response, and response by https, goes into an infinite loop
Steps To Reproduce1.Start libmicrohttpd HTTPS, like
    struct MHD_OptionItem options[] = {
        { MHD_OPTION_HTTPS_MEM_KEY, 0, key },
        { MHD_OPTION_HTTPS_MEM_CERT, 0, cert },
        { MHD_OPTION_HTTPS_MEM_TRUST, 0, cacert },
        { MHD_OPTION_END, 0, NULL },
    };
    daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_SSL,
        12345, NULL, NULL, ahc, &s_httpd,
        MHD_OPTION_ARRAY, options,
        MHD_OPTION_END);

2.when a connection come, response it like
    response = MHD_create_response_from_buffer (0, NULL, MHD_RESPMEM_PERSISTENT);
    if(response == NULL) {
        return -1;
    }
    ret = MHD_queue_response (connection, errcode, response);

    MHD_destroy_response (response);

3. CPU utilization becomes 100%.
Additional Information1. In libmicrohttpd's src/daemon/connection.c, MHD_connection_handle_write() is always invoked, and connection->state is always MHD_CONNECTION_NORMAL_BODY_READY(12).

2. This bug is not exists without https.
TagsNo tags attached.

Activities

Christian Grothoff

2013-03-04 13:44

manager   ~0006927

I've added a testcase for this in SVN 26293 (test_empty_response.c). However, the test passes nicely on my system.

Now, you reported the bug against 0.9.24, and there was a bugfix with respect to a response size of zero on January 6th (just after 0.9.24, part of 0.9.25) which might have addressed this issue already. Could you please run the test and try it with SVN HEAD and/or 0.9.25 to see if the bug was already fixed?

Christian Grothoff

2021-09-02 15:54

manager   ~0018212

Fix committed to master branch.

Issue History

Date ModifiedUsernameFieldChange
2013-02-08 02:10klx.loginNew Issue
2013-03-04 12:48Christian GrothoffAssigned To => Christian Grothoff
2013-03-04 12:48Christian GrothoffStatusnew => assigned
2013-03-04 12:48Christian GrothoffTarget Version => 0.9.26
2013-03-04 13:44Christian GrothoffNote Added: 0006927
2013-03-04 13:44Christian GrothoffStatusassigned => feedback
2013-03-05 02:06klx.loginStatusfeedback => assigned
2013-03-05 04:50Christian GrothoffStatusassigned => resolved
2013-03-05 04:50Christian GrothoffFixed in Version => 0.9.25
2013-03-05 04:50Christian GrothoffResolutionopen => fixed
2013-03-05 04:50Christian GrothoffStatusresolved => closed
2013-03-05 04:50Christian GrothoffTarget Version0.9.26 => 0.9.25
2013-05-06 10:54Christian GrothoffCategoryHTTP GET => HTTP GET/HEAD
2021-09-02 15:54Christian Grothoff
2021-09-02 15:54Christian GrothoffNote Added: 0018212