[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] evhttp request connection close
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.
Niels.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.