Skip to content
Snippets Groups Projects
Unverified Commit f54fc91c authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

multi: do a final progress update on connect failure

To fix timing metric etc

Co-authored-by: Justin Maggard
Fixes #14204
parent 1f877b0f
No related merge requests found
......@@ -2643,6 +2643,7 @@ statemachine_end:
else if(data->mstate == MSTATE_CONNECT) {
/* Curl_connect() failed */
(void)Curl_posttransfer(data);
Curl_pgrsUpdate_nometer(data);
}
multistate(data, MSTATE_COMPLETED);
......
......@@ -587,10 +587,8 @@ static void progress_meter(struct Curl_easy *data)
* Curl_pgrsUpdate() returns 0 for success or the value returned by the
* progress callback!
*/
int Curl_pgrsUpdate(struct Curl_easy *data)
static int pgrsupdate(struct Curl_easy *data, bool showprogress)
{
struct curltime now = Curl_now(); /* what time is it */
bool showprogress = progress_calc(data, now);
if(!(data->progress.flags & PGRS_HIDE)) {
if(data->set.fxferinfo) {
int result;
......@@ -631,3 +629,19 @@ int Curl_pgrsUpdate(struct Curl_easy *data)
return 0;
}
int Curl_pgrsUpdate(struct Curl_easy *data)
{
struct curltime now = Curl_now(); /* what time is it */
bool showprogress = progress_calc(data, now);
return pgrsupdate(data, showprogress);
}
/*
* Update all progress, do not do progress meter/callbacks.
*/
void Curl_pgrsUpdate_nometer(struct Curl_easy *data)
{
struct curltime now = Curl_now(); /* what time is it */
(void)progress_calc(data, now);
}
......@@ -54,6 +54,8 @@ CURLcode Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size);
void Curl_ratelimit(struct Curl_easy *data, struct curltime now);
int Curl_pgrsUpdate(struct Curl_easy *data);
void Curl_pgrsUpdate_nometer(struct Curl_easy *data);
void Curl_pgrsResetTransferSizes(struct Curl_easy *data);
struct curltime Curl_pgrsTime(struct Curl_easy *data, timerid timer);
timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment