cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: embedded linux libcurl upload data inactivity timeout not working

From: John Coffey <johnco3_at_gmail.com>
Date: Mon, 8 Dec 2014 11:48:19 -0500

Daniel,

I discovered something in the code that might explain the cause of this
error - however I am not sure why the 900 second inactivity timeout works
on Windows and not on our Linux target where we get an error after exactly
60 seconds of inactivity at the end of the transfer just prior to receiving
the FTP response:

In the ftp_done code (ftp.c) line 3201 there is a very suspicious 1 minute
timer that causes the value in data->set.server_response_timeout (set to
900000) in my case to become ignored. Perhaps this will shed some light on
the problem.

John

  if(!result && (ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid &&
     pp->pending_resp && !premature) {
    /*
     * Let's see what the server says about the transfer we just performed,
     * but lower the timeout as sometimes this connection has died while the
     * data has been transferred. This happens when doing through NATs etc
that
     * abandon old silent connections.
     */
    long old_time = pp->response_time;

    pp->response_time = 60*1000; /* give it only a minute for now */
    pp->response = Curl_tvnow(); /* timeout relative now */

    result = Curl_GetFTPResponse(&nread, conn, &ftpcode);

    pp->response_time = old_time; /* set this back to previous value */

On Sat, Dec 6, 2014 at 6:33 PM, John Coffey <johnco3_at_gmail.com> wrote:

> Hello Daniel,
>
> I sent a question to the forum the other day, but in retrospect, perhaps I
> did not give sufficient background for others to answer the question,
> anyways, I re-asked the question with a bit more context on StackOverflow
> in the hopes that perhaps someone else may have encountered this problem -
> fixing it is critical for us to deploy the application. I was going
> through the code in the lib-curl timers area yesterday and my gut feel is
> that there is some problem with the timer queues.
>
> Firstly, I was wondering if you are aware of some issue like the one I
> described - it appears to be Linux specific, however I am not sure if it is
> specific to Linux on the PowerPC platform or of it is a general linux
> libCurl issue. Alternatively, do you know of a good place where I could
> add some debug printout code to show where the specific timer expires in
> the code so that I might catch the root cause of the 60 second timer
> expiration which causes the ftp connection to terminate during an extended
> period of inactivity over the data connection during an upload. I tried
> many work arounds, including keep alive timers (which I can see are active
> during the period of inactivity). I also tried changing various TCP
> options via sysctl options - but so far none of these attempts at working
> around the problem have proven fruitful.
>
> Here is a link to the reposed question on StackOverflow
>
>
> http://stackoverflow.com/questions/27337649/libcurl-upload-data-inactivity-timeout-not-working
>
> All the best and thanks for libCurl
>
> John Coffey
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-08