TFTP: make the CURLOPT_LOW_SPEED* options work

... this also makes sure that the progess callback gets called more
often during TFTP transfers.

Added test 1238 to verify.

Bug: http://curl.haxx.se/bug/view.cgi?id=1269
Reported-by: Jo3
This commit is contained in:
Daniel Stenberg 2013-08-22 22:40:38 +02:00
parent 06d1b10cbe
commit 4bea91fc67
3 changed files with 60 additions and 1 deletions

View file

@ -56,6 +56,7 @@
#include "multiif.h"
#include "url.h"
#include "rawstr.h"
#include "speedcheck.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@ -1255,6 +1256,15 @@ static CURLcode tftp_doing(struct connectdata *conn, bool *dophase_done)
if(*dophase_done) {
DEBUGF(infof(conn->data, "DO phase is complete\n"));
}
else {
/* The multi code doesn't have this logic for the DOING state so we
provide it for TFTP since it may do the entire transfer in this
state. */
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
else
result = Curl_speedcheck(conn->data, Curl_tvnow());
}
return result;
}