aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-06-17 15:19:30 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-06-17 15:19:30 +0200
commit01c2b397aa58a8727f3b12ca0808dc602fc4901e (patch)
treeb00d6de3dbebd1767fb601acb6643983a344d09e
parent51a757c11bce9ccf9069af606bc2d8b7df584eb3 (diff)
multi: call the progress function only once and allow abort
1) no need to call the progress function twice when in the CURLM_STATE_TOOFAST state. 2) Make sure that the progress callback's return code is acknowledged when used
-rw-r--r--lib/multi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/multi.c b/lib/multi.c
index f210dcf04..af1db606c 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1307,7 +1307,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
case CURLM_STATE_TOOFAST: /* limit-rate exceeded in either direction */
/* if both rates are within spec, resume transfer */
- Curl_pgrsUpdate(easy->easy_conn);
if( ( ( easy->easy_handle->set.max_send_speed == 0 ) ||
( easy->easy_handle->progress.ulspeed <
easy->easy_handle->set.max_send_speed ) ) &&
@@ -1528,8 +1527,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
multistate(easy, CURLM_STATE_COMPLETED);
}
- else
- Curl_pgrsUpdate(easy->easy_conn);
+ else if(Curl_pgrsUpdate(easy->easy_conn))
+ easy->result = CURLE_ABORTED_BY_CALLBACK;
}
} while(0);
if((CURLM_STATE_COMPLETED == easy->state) && !easy->msg) {