View Issue Details

IDProjectCategoryView StatusLast Update
0002783libmicrohttpdHTTP GET/HEADpublic2021-09-02 17:54
Reporterklx.login Assigned ToChristian Grothoff  
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 14: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 17:54

manager   ~0018212

Fix committed to master branch.

Related Changesets

libmicrohttpd: master dab82f19

2013-05-09 15:48

Christian Grothoff


Details Diff
-undo fix 0002783 Affected Issues
0002783
mod - src/microhttpd/connection.c Diff File

Issue History

Date Modified Username Field Change
2013-02-08 03:10 klx.login New Issue
2013-03-04 13:48 Christian Grothoff Assigned To => Christian Grothoff
2013-03-04 13:48 Christian Grothoff Status new => assigned
2013-03-04 13:48 Christian Grothoff Target Version => 0.9.26
2013-03-04 14:44 Christian Grothoff Note Added: 0006927
2013-03-04 14:44 Christian Grothoff Status assigned => feedback
2013-03-05 03:06 klx.login Status feedback => assigned
2013-03-05 05:50 Christian Grothoff Status assigned => resolved
2013-03-05 05:50 Christian Grothoff Fixed in Version => 0.9.25
2013-03-05 05:50 Christian Grothoff Resolution open => fixed
2013-03-05 05:50 Christian Grothoff Status resolved => closed
2013-03-05 05:50 Christian Grothoff Target Version 0.9.26 => 0.9.25
2013-05-06 12:54 Christian Grothoff Category HTTP GET => HTTP GET/HEAD
2021-09-02 17:54 Christian Grothoff Changeset attached => libmicrohttpd master dab82f19
2021-09-02 17:54 Christian Grothoff Note Added: 0018212