libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Problems with parsing POST data


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Problems with parsing POST data
Date: Fri, 13 Mar 2009 13:48:19 -0600
User-agent: KMail/1.9.9

This sounds to me like it might be a problem in how you implemented your 
callback.  You are supposed to NOT queue a response until all of the upload 
data that you expect to get (based on the header, etc.) has been received (or 
*upload_data_size is zero the second time).  

You can find an example for how to do this in src/testcurl/daemontest_post.c.

Christian

On Friday 13 March 2009 05:13:14 am Peter Ross wrote:
> Hi,
>
> I am using libmicrohttpd to parse POST x-www-form-urlencoded data.
> Ocassionally I observe a "problem" whereby POST data is sent by the
> webbrowser (confirmed using wireshark), but the POST data is not being
> parsed by libmicrohttpd.
>
> Diagnosis: It appears that upon accepting the client's connection, the
> first call libmicrohttpd makes to TCP/IP recv() returns the complete HTTP
> header, but not the subsequent POST data. This causes the connection
> handler/ callback function to be invoked with *upload_data_size=0, however
> connection->remaining_upload_size is set to the Content-Length length
> (which equates to the number of yet-to-be-received POST data).
>
> When MHD_post_process() is later called with *upload_data_size, the
> function considers there to be no POST data to parse, and returns
> immediately.
>
> Is this a bug, missing feature, or am I doing something wrong?
>
> Cheers,
>
> -- Peter
> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)



-- 
Christian Grothoff
Assistant Professor
Department of Computer Science
University of Denver


reply via email to

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