mirror of
https://github.com/curl/curl.git
synced 2026-08-24 20:23:40 +03:00
getinfo: CURLINFO_QUEUE_TIME_T
Returns the time, in microseconds, during which this transfer was held in a waiting queue before it started "for real". A transfer might be put in a queue if after getting started, it cannot create a new connection etc due to set conditions and limits imposed by the application. Ref: #12293 Closes #12368
This commit is contained in:
parent
2b221d4214
commit
68f96fc9bf
10 changed files with 109 additions and 11 deletions
|
|
@ -409,6 +409,9 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
|
|||
case CURLINFO_STARTTRANSFER_TIME_T:
|
||||
*param_offt = data->progress.t_starttransfer;
|
||||
break;
|
||||
case CURLINFO_QUEUE_TIME_T:
|
||||
*param_offt = data->progress.t_postqueue;
|
||||
break;
|
||||
case CURLINFO_REDIRECT_TIME_T:
|
||||
*param_offt = data->progress.t_redirect;
|
||||
break;
|
||||
|
|
@ -420,7 +423,7 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
|
|||
break;
|
||||
case CURLINFO_CONN_ID:
|
||||
*param_offt = data->conn?
|
||||
data->conn->connection_id : data->state.recent_conn_id;
|
||||
data->conn->connection_id : data->state.recent_conn_id;
|
||||
break;
|
||||
default:
|
||||
return CURLE_UNKNOWN_OPTION;
|
||||
|
|
|
|||
|
|
@ -1943,6 +1943,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
}
|
||||
|
||||
if(!result) {
|
||||
*nowp = Curl_pgrsTime(data, TIMER_POSTQUEUE);
|
||||
if(async)
|
||||
/* We're now waiting for an asynchronous name lookup */
|
||||
multistate(data, MSTATE_RESOLVING);
|
||||
|
|
|
|||
|
|
@ -174,10 +174,18 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer,
|
|||
data->progress.t_startop = timestamp;
|
||||
break;
|
||||
case TIMER_STARTSINGLE:
|
||||
/* This is set at the start of each single fetch */
|
||||
/* This is set at the start of each single transfer */
|
||||
data->progress.t_startsingle = timestamp;
|
||||
data->progress.is_t_startransfer_set = false;
|
||||
break;
|
||||
case TIMER_POSTQUEUE:
|
||||
/* Set when the transfer starts (after potentially having been brought
|
||||
back from the waiting queue). It needs to count from t_startop and not
|
||||
t_startsingle since the latter is reset when a connection is brought
|
||||
back from the pending queue. */
|
||||
data->progress.t_postqueue =
|
||||
Curl_timediff_us(timestamp, data->progress.t_startop);
|
||||
break;
|
||||
case TIMER_STARTACCEPT:
|
||||
data->progress.t_acceptdata = timestamp;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@
|
|||
typedef enum {
|
||||
TIMER_NONE,
|
||||
TIMER_STARTOP,
|
||||
TIMER_STARTSINGLE,
|
||||
TIMER_STARTSINGLE, /* start of transfer, might get queued */
|
||||
TIMER_POSTQUEUE, /* start, immediately after dequeue */
|
||||
TIMER_NAMELOOKUP,
|
||||
TIMER_CONNECT,
|
||||
TIMER_APPCONNECT,
|
||||
|
|
|
|||
|
|
@ -1189,6 +1189,7 @@ struct Progress {
|
|||
curl_off_t dlspeed;
|
||||
curl_off_t ulspeed;
|
||||
|
||||
timediff_t t_postqueue;
|
||||
timediff_t t_nslookup;
|
||||
timediff_t t_connect;
|
||||
timediff_t t_appconnect;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue