cURL / Mailing Lists / curl-library / Single Mail


Re: Curl_retry_request

From: <>
Date: Thu, 17 Dec 2009 13:34:52 -0800

On Wed, Dec 16, 2009 at 11:28:26AM -0800, Kevin Baughman wrote:
> I have an application that is occasionally seeing this debug message:
> * SSL read: errno -5961
> * Connection died, retrying a fresh connect
> * Closing connection #1
> I noticed in the function Curl_retry_request() there seems to be no
> way to disable this behavior. Is there any kind of option that will
> disable ever retrying the request under these circumstances?
> if((data->req.bytecount +
> data->req.headerbytecount == 0) &&
> conn->bits.reuse &&
> !data->set.opt_no_body) {
> /* We got no data, we attempted to re-use a connection and yet we want a
> "body". This might happen if the connection was left alive when we were
> done using it before, but that was closed when we wanted to read from
> it again. Bad luck. Retry the same request on a fresh connect! */
> infof(conn->data, "Connection died, retrying a fresh connect\n");
> *url = strdup(conn->data->change.url);
> conn->bits.close = TRUE; /* close this connection */
> conn->bits.retry = TRUE; /* mark this as a connection we're about
> to retry. Marking it this way should
> prevent i.e HTTP transfers to return
> error just because nothing has been
> transfered! */
> retry = TRUE;
> }
> I can add a user defined option for this, but wanted to make sure I
> was correct in saying there is no way to disable this.

First, why would you want to disable retrying a request? This only
happens when you've told curl that it's okay to re-use connections. To
be in this code, you tried to re-use a connection but failed. Are you
saying that you want your code to always use a new connection, or to
give up entirely if it cannot re-use a connection?

Second, there's already a way to disable connection re-use. The third
line of this conditional, "conn->bits.reuse" checks whether re-use is
enabled or not. You can already configure this with CURLOPT_FORBID_REUSE.

What problem are you trying to solve, exactly?

List admin:
Received on 2009-12-17