cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl doesn't responds to FIN requests.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 19 Dec 2014 23:23:42 +0100 (CET)

On Thu, 11 Dec 2014, trilok nuwal wrote:

Hello and sorry for the long delay before responding.

> we are using the persistent connection between client and server. Connection
> remains alive around 15 seconds after the last use and then server sends the
> FIN request which curl responds with ACK but it doesn't sends the FIN that
> means it doesn't close the sockets which cause connection to remain alive
> even after server sends FIN.
>
> later after 2 mins, server sends the RESET and finally curl closes the
> connection.
>
> we have questions ??
>
> It is by design or it is a bug in curl ?

That's a very simplistic description with a lot of details missing. What is
your application/curl doing after those 15 seconds?

curl has no thread that monitors connections dying so at times connections can
go stale without curl noticing but the next time you tell curl to do something
it'll notice the dead connections and kill them off.

> Do we as CURL users, have some mechanism to know that the server has sent
> the FIN and we forcefully close the socket.

No, that would require someone to keep waiting for activity on the sockets and
curl doesn't do that.

-- 
  / 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 2014-12-19