~ubuntu-branches/ubuntu/saucy/curl/saucy-201307251546

« back to all changes in this revision

Viewing changes to lib/transfer.c

  • Committer: Bazaar Package Importer
  • Author(s): Ramakrishnan Muthukrishnan
  • Date: 2010-10-18 11:13:17 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20101018111317-9rkas34ecwtq0upn
Tags: upstream-7.21.2
ImportĀ upstreamĀ versionĀ 7.21.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
#include "multiif.h"
104
104
#include "easyif.h" /* for Curl_convert_to_network prototype */
105
105
#include "rtsp.h"
 
106
#include "connect.h"
106
107
 
107
108
#define _MPRINTF_REPLACE /* use our functions only */
108
109
#include <curl/mprintf.h>
594
595
 
595
596
          dataleft = conn->chunk.dataleft;
596
597
          if(dataleft != 0) {
597
 
            infof(conn->data, "Leftovers after chunking. "
598
 
                  " Rewinding %zu bytes\n",dataleft);
599
 
            read_rewind(conn, dataleft);
 
598
            infof(conn->data, "Leftovers after chunking: %zu bytes", dataleft);
 
599
            if(conn->data->multi && Curl_multi_canPipeline(conn->data->multi)) {
 
600
              /* only attempt the rewind if we truly are pipelining */
 
601
              infof(conn->data, "Rewinding %zu bytes\n",dataleft);
 
602
              read_rewind(conn, dataleft);
 
603
            }
600
604
          }
601
605
        }
602
606
        /* If it returned OK, we just keep going */
1060
1064
    return result;
1061
1065
 
1062
1066
  if(k->keepon) {
1063
 
    if(data->set.timeout &&
1064
 
       (Curl_tvdiff(k->now, k->start) >= data->set.timeout)) {
 
1067
    if(0 > Curl_timeleft(conn, &k->now, FALSE)) {
1065
1068
      if(k->size != -1) {
1066
1069
        failf(data, "Operation timed out after %ld milliseconds with %"
1067
1070
              FORMAT_OFF_T " out of %" FORMAT_OFF_T " bytes received",
1068
 
              Curl_tvdiff(k->now, k->start), k->bytecount, k->size);
 
1071
              Curl_tvdiff(k->now, data->progress.t_startsingle), k->bytecount,
 
1072
              k->size);
1069
1073
      }
1070
1074
      else {
1071
1075
        failf(data, "Operation timed out after %ld milliseconds with %"
1072
1076
              FORMAT_OFF_T " bytes received",
1073
 
              Curl_tvdiff(k->now, k->start), k->bytecount);
 
1077
              Curl_tvdiff(k->now, data->progress.t_startsingle), k->bytecount);
1074
1078
      }
1075
1079
      return CURLE_OPERATION_TIMEDOUT;
1076
1080
    }
1343
1347
         to work with, skip the timeout */
1344
1348
      timeout_ms = 0;
1345
1349
    else {
1346
 
      if(data->set.timeout) {
1347
 
        totmp = (int)(data->set.timeout - Curl_tvdiff(k->now, k->start));
1348
 
        if(totmp < 0)
1349
 
          return CURLE_OPERATION_TIMEDOUT;
1350
 
      }
1351
 
      else
 
1350
      totmp = Curl_timeleft(conn, &k->now, FALSE);
 
1351
      if(totmp < 0)
 
1352
        return CURLE_OPERATION_TIMEDOUT;
 
1353
      else if(!totmp)
1352
1354
        totmp = 1000;
1353
1355
 
1354
1356
      if (totmp < timeout_ms)
1433
1435
  Curl_initinfo(data); /* reset session-specific information "variables" */
1434
1436
  Curl_pgrsStartNow(data);
1435
1437
 
 
1438
  if(data->set.timeout)
 
1439
    Curl_expire(data, data->set.timeout);
 
1440
 
 
1441
  if(data->set.connecttimeout)
 
1442
    Curl_expire(data, data->set.connecttimeout);
 
1443
 
1436
1444
  return CURLE_OK;
1437
1445
}
1438
1446