cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl_retry_request

From: Kevin Baughman <curb_pks_at_yahoo.com>
Date: Thu, 17 Dec 2009 10:38:41 -0800 (PST)

I created a patch to skip the retry in the Curl_retry_request function if the CURLOPT_DISABLE_RETRIES flag is set. For my issue it seems to work, but someone else may know this code better and if it is safe or not.

Thanks,
Kevin

________________________________
From: Kevin Baughman <curb_pks_at_yahoo.com>
To: Curl Library <curl-library_at_cool.haxx.se>
Sent: Wed, December 16, 2009 2:28:26 PM
Subject: Curl_retry_request

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.

Thanks,
Kevin

      

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2009-12-17