[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] evhttp request connection close



On Tue, 27 Apr 2010, Niels Provos wrote:

On Tue, Apr 27, 2010 at 12:14 AM, Sten Spans <sten@xxxxxxxxxxxxxxxx> wrote:
Is inserting a Connection close header in the last request the best way to
complete the event-loop? Wouldn't it be better to reset _outgoing_
connections in evhttp_connection_done when all requests are handled?
Something like the following diff:

That's how HTTP/1.1 works.  Adding the header is the way to close the
connection if you know that you are not going to use it again.
Closing it if there are no queued requests reduces the opportunity for
re-using a connection for requests that might arrive after you send
the previous request, e.g. think a proxy or some other event driven
mechanisms where the events are outside of your control.

I kinda figured as much, I'll make sure to stick the header in
my final request. Thanks for the confirmation.

--
Sten Spans

"There is a crack in everything, that's how the light gets in."
Leonard Cohen - Anthem
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.