[Top][All Lists]

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

[libmicrohttpd] unable to respond before reading entire incoming payload

From: Ken Zangelin
Subject: [libmicrohttpd] unable to respond before reading entire incoming payload
Date: Mon, 12 Dec 2016 15:02:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


I am provoking a request for 'Payload too large' for our MHD server, by using curl sending a short request (~25 bytes) but adding a Content-Len header of a lot more (2 megabytes).

In our case the maximum payload we accept is a megabyte.

So, in the mhd callback routines we detect the Content-Len header (and probably read the 25 bytes of payload as well, haven't checked) and when we see that the Content-Len header value is beyond our allowed max size, we want to return a response with a payload telling the user about the error.

We've tried to set the upload_data_size pointer to point to ZERO, awaiting the last call to the callback, but it never comes.

Probably due to that MHD still believes there is more data to read.

Using MHD_OPTION_CONNECTION_TIMEOUT, at least the connection resets instead of hangs, but ... we'd like to send that response ...

Is there any way to accomplish what we want?

Thank you!


reply via email to

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