libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] MHD_queue_response failing


From: Peter Ross
Subject: [libmicrohttpd] MHD_queue_response failing
Date: Sun, 18 Sep 2011 12:49:50 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

When responding to a POST request with application/octet-stream content I am 
finding
that MHD_queue_response fails. Usage example below.

Digging inside libmicrphttpd, the queue_response fails because the 
connection->state is
MHD_CONNECTION_CONTINUE_SENT. The connection in this instance does not use HTTP 
100 continues.
The enclosed patch fixes the behaviour.

---
AccessHandlerCallback(...)

    if (!strcmp(method,"POST") && !partial_strcmp_left(url,"/process")) {

        /* On the first callback interation, *upload_data_size is zero.
           Upon second iteration, it is non-zero and contains 48-byte message */

        if (!*upload_data_size)
            return MHD_YES;

        /* process upload_data.. */

        rsp = MHD_create_response_from_data(sizeof(response), response, MHD_NO, 
MHD_NO);
        ret = MHD_queue_response(connection, MHD_HTTP_OK, rsp);
    }
---

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)

Attachment: permit_queue_response_on_continue_sent_state.diff
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]