clean up start time and t_startsingle use so that redirect_time works properly

This commit is contained in:
Daniel Stenberg 2004-11-15 11:27:03 +00:00
parent 8475a0df2f
commit 5931d43a36
6 changed files with 28 additions and 16 deletions

View file

@ -491,7 +491,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
*connected = FALSE; /* a very negative world view is best */
/* Evaluate in milliseconds how much time that has passed */
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
/* subtract the most strict timeout of the ones */
if(data->set.timeout && data->set.connecttimeout) {
@ -716,7 +716,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
long has_passed;
/* Evaluate in milliseconds how much time that has passed */
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))

View file

@ -1,10 +1,10 @@
#ifndef __PROGRESS_H
#define __PROGRESS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
@ -12,7 +12,7 @@
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
@ -37,7 +37,7 @@ typedef enum {
TIMER_REDIRECT,
TIMER_LAST /* must be last */
} timerid;
void Curl_pgrsDone(struct connectdata *);
void Curl_pgrsStartNow(struct SessionHandle *data);
void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size);

View file

@ -1273,7 +1273,7 @@ Curl_SSLConnect(struct connectdata *conn,
long has_passed;
/* Evaluate in milliseconds how much time that has passed */
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
/* get the most strict timeout of the ones converted to milliseconds */
if(data->set.timeout &&

View file

@ -2259,11 +2259,6 @@ static CURLcode CreateConnection(struct SessionHandle *data,
conn->range = data->set.set_range; /* clone the range setting */
conn->resume_from = data->set.set_resume_from; /* inherite resume_from */
/* Set the start time temporary to this creation time to allow easier
timeout checks before the transfer has started for real. The start time
is later set "for real" using Curl_pgrsStartNow(). */
conn->data->progress.start = conn->created;
conn->bits.user_passwd = data->set.userpwd?1:0;
conn->bits.proxy_user_passwd = data->set.proxyuserpwd?1:0;
conn->bits.no_body = data->set.opt_no_body;