[Top][All Lists]

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

Re: [libmicrohttpd] Problems receiving POST data.

From: Christian Grothoff
Subject: Re: [libmicrohttpd] Problems receiving POST data.
Date: Wed, 14 May 2014 19:54:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10

On 05/14/2014 07:48 PM, Pawel Veselov wrote:
> On Wed, May 14, 2014 at 4:56 AM, Christian Grothoff <address@hidden>wrote:
>> On 05/14/2014 12:43 PM, Pawel Veselov wrote:
>>> /me shamefully found
>>> Is it then generally safe to assume that with "POST" method, I can always
>>> reply with MHD_YES, expecting that access handler will be called again,
>> or
>>> do I need to check for crazy agents that may post with a 0
>> content-length?
>> It is always safe to return MHD_YES.  MHD_NO must only be returned if the
>> connection must be closed due to a hard error, no HTTP error code is
>> generated.
> I'm sorry, I meant "safe to just return MHD_YES", implying that whatever
> processing I need to do for the response can be delayed,
> because I'm guaranteed to being called back at least one more time.

Yes, that's correct.

> If method is "POST", and context is 0, create context
> Else, if *upload_bytes is 0, prepare for end of request, create status
> Else, do whatever you need to do for incoming data
> Return MHD_YES

Right, that's the basic logic.

reply via email to

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