curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: unexpected code 35 (if tcp listen backlog is full)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 14 Jan 2018 23:02:52 +0100 (CET)

On Sun, 14 Jan 2018, Michael Kilburn wrote:

> this:
> http://veithen.github.io/2014/01/01/how-tcp-backlog-works-in-linux.html
> suggests it is possible -- if accept queue is full, ACK gets discarded while
> from client perspective connection is established and it will start sending
> data (initiating TLS handshake). And eventual RST from server (because it
> could not acknowledge resent ACKs due to full accept queue) will cause
> connection drop while libcurl TLS logic waits for response. Do you think
> this is what happens? Can code 35 be returned in this situation?

It seems like a plausible scenario, yes!

> If I am to use my own cache of easy handles -- how it is going to work wrt
> TLS? Afair, TLS handshake needs to be renewed/renegotiated on regular basis
> -- what if my handle wasn't used for 10 mins? 2 hours?

libcurl will handle that for you transparently. You should always be able to
re-use an existing easy handle for subsequent requests. Also, if you use the
multi interface, the connection pool is actually owned/held by the multi
handle so then re-using easy handles isn't that important.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-01-14