[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] queuing error with MHD_queue_response in the middle of r
[libmicrohttpd] queuing error with MHD_queue_response in the middle of receiving data
Fri, 7 Dec 2018 10:56:33 +0000
I have an application which tries to call 
MHD_queue_response(..., MHD_HTTP_PAYLOAD_TOO_LARGE, ...) when received
data is deemed to large. Unfortunately MHD_queue_response() always returns
connection->state is MHD_CONNECTION_CONTINUE_SENT at the time of this call,
so the first check in MHD_queue_response() fails. The callback
function gets the error back from MHD_queue_response() and propagates that,
and the whole connection is aborted with
"Application reported internal error, closing connection.".
In this case waiting until the all of the input data has been read is
not an attractive option (the data is potentially large and we don't want
to waste sender or receiver time to pass bytes that will be discarded anyway).
Is sending an error "in the middle" like this not supported at all?
It would be really nice if the client would get the 413 code with the
- [libmicrohttpd] queuing error with MHD_queue_response in the middle of receiving data,
Zbigniew Jędrzejewski-Szmek <=