On 09/19/2012 07:54 PM, Eivind Sarto wrote: > Hi, > > Most (all?) of the examples in libmicrohttpd will queue the response from the > second call to the client handler. > > If you already know that you want to respond with an error during the initial > call to the client handler (client context ptr == NULL), > would it be appropriate to queue the reply immediately?
Yes. > What would be the ramifications of queueing an error response immediately? That MHD does not send "100 CONTINUE" if the protocol is HTTP/1.1 and the client asked for 100 CONTINUE. So if you queue the error message immediately (during PUT/POST), you avoid the traffic upload from the client. For GET/HEAD requests, it makes no difference whatsoever (you can even queue 200 OK instantly without complications). Happy hacking! Christian
