[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Abort POST request in libmicrohttpd
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Abort POST request in libmicrohttpd |
Date: |
Tue, 19 Mar 2019 18:44:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
Yes, you can simply queue any response. As long as you do this on the
_first_ callback to the access handler (and as long as the client
expected "100 continue"), this will provide a proper error message and
prevent the upload.
Happy hacking!
Christian
On 3/19/19 2:12 PM, Дмитрий Степанов wrote:
> Hello!
>
> Is it possible to abort big POST request from the client (actually
> client uses chunked transfer encoding) by sending 500 (or whenever else)
> error with body that contains useful information?
> I'm able to abort POST request in MHD_AccessHandlerCallback simply
> returning MHD_NO, but in that case libmicrohttpd just resets the connection.
> If i try to send a response in MHD_AccessHandlerCallback while
> *upload_data_size is not zero (client's POST request in
> progress)- MHD_queue_response returns MHD_NO (reponse is not actually
> sent).
>
> Thanks!
signature.asc
Description: OpenPGP digital signature