libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] How to give busy message to second file upload clien


From: Sebastian Gerhardt
Subject: Re: [libmicrohttpd] How to give busy message to second file upload client when 1st client file
Date: Wed, 20 Aug 2008 20:38:10 +0200

Hello,

I tried around a bit and from what I can tell, the browser 
does not display the response body of a POST request unless 
the post iterator has been called at least once. Not sure yet
whether this issues comes from the browser, which insists on
delivering at least one chunk before accepting any response
bodies, or whether this is a policy of MHD.

This implies that you can't create a custom response at such
an early stage. Instead, you have to create the postprocessor
unconditionally and also have the iterator called--even if you
know already that you won't store the POST data. The iterator
can then be aborted right at the beginning by returning MHD_NO.
(You could write the busy-string in the answer part of the
connection_info_struct.)

The send_page function should be extended so that it takes an integer
for the status code. That way, it could return the recommended 
HTTP 503 Service Unavailable 
status code in such a case.


On Wed, 2008-08-20 at 10:15 -0400, sudhansu sahoo wrote:
> Hello,
> Thank you very much for your help, Now I am able to upload files into
> server using libmicrohttpd(code attached below) successfully.
> 
> I am trying to write code to upload one file at a time into the
> server, so if any other user try to upload his file while 1st user's
> file upload is in progress he should get a message that " Server is
> busy processing another user's request so please wait". I thought this
> message can be placed in  " postexample_answerRequest" method as shown
> below in the code example but not able to do that as the client
> connection is refused rather than getting a message that server is
> busy. Could you please have a look into the code below and help me
> where I can put this message?
> _______________________________________________
> libmicrohttpd mailing list
> address@hidden
> http://crisp.cs.du.edu/cgi-bin/mailman/listinfo/libmicrohttpd



reply via email to

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