libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] MHD_queue_response


From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD_queue_response
Date: Wed, 8 Jun 2011 15:53:23 +0200
User-agent: KMail/1.13.5 (Linux/2.6.39-1-amd64; KDE/4.4.5; x86_64; ; )

You are probably returning MHD_NO from the callback on the first call.  If you 
instead wait for the "second" call (for GET, or for the "last" call after 
processing all of the upload data for POST/PUSH), then pipelining will keep 
working.  Look at the "fileserver_example.c" for a way to do it (it gives a 
'file not found error', roughly in the way you'd want to do it.

Happy hacking,

Christian

On Tuesday 07 June 2011 19:17:10 Bourdeau, Yann wrote:
> Hi!
> 
>                 I'm using the library and reject (invalid URL) a connection
> "early" in the callback MHD_AccessHandlerCallback. When a call
> MHD_queue_response I always go in the following code that terminate the
> connection: if (connection->state == MHD_CONNECTION_HEADERS_PROCESSED)
>     {
>       /* response was queued "early",
>          refuse to read body / footers or further
>          requests! */
>       SHUTDOWN (connection->socket_fd, SHUT_RD);
>       connection->read_closed = MHD_YES;
>       connection->state = MHD_CONNECTION_FOOTERS_RECEIVED;
>     }
> 
> Is it possible to keep the connection open and to send a response "early"?
> 
> I'm using version 0.4.6. If this is fixed in a later version, I'll do the
> upgrade.
> 
> Thanks
> Yann Bourdeau



reply via email to

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