libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] queuing error with MHD_queue_response in the middle of r


From: Zbigniew Jędrzejewski-Szmek
Subject: [libmicrohttpd] queuing error with MHD_queue_response in the middle of receiving data
Date: Fri, 7 Dec 2018 10:56:33 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

I have an application which tries to call [1]
MHD_queue_response(..., MHD_HTTP_PAYLOAD_TOO_LARGE, ...) when received
data is deemed to large. Unfortunately MHD_queue_response() always returns 
MHD_NO.
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
informative message.

Thanks,
Zbyszek

[1] 
https://github.com/systemd/systemd/blob/master/src/journal-remote/journal-remote-main.c#L220



reply via email to

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