From 4bea91fc677359f3dcedb05a431258b6cd5d98f3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 22 Aug 2013 22:40:38 +0200 Subject: 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 --- lib/tftp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/tftp.c') diff --git a/lib/tftp.c b/lib/tftp.c index b582ab319..f1ffd2a3a 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -56,6 +56,7 @@ #include "multiif.h" #include "url.h" #include "rawstr.h" +#include "speedcheck.h" #define _MPRINTF_REPLACE /* use our functions only */ #include @@ -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; } -- cgit v1.2.3