cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How does curl implement http 1.1 / http1.0 keep alive?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 10 Jan 2013 11:48:00 +0100 (CET)

On Wed, 9 Jan 2013, Johan Moraal wrote:

> I'm busy with my own http server implementation on an embedded platform.
> Technically the server is HTTP 1.0 compliant, and therefore it expects the
> the client to send the header "Connection: Keep-Alive" to keep the
> connection open.

You'll also see that curl leaves the connection open after its request:

> * Connection #0 to host 10.84.67.129 left intact

... but when it later wants to re-use the connection it left open:

> * Connection #0 seems to be dead!

... the connection seems to be non-functional and it needs to create a new
one. The check there checks if the socket is readable and if it is, it is a
bad situation and it is therefore considered to be a dead connection. See
lib/url.c:SocketIsDead() called from ConnectionExists().

> I'm sure I implemented the HTTP 1.0 keep-alive functionality correctly.

Then please point out the error in curl. I'm not aware of any particular error
in this part of the code in any recent curl version.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-10