aboutsummaryrefslogtreecommitdiff
path: root/lib/tftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-08-22 22:40:38 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-08-22 22:42:27 +0200
commit4bea91fc677359f3dcedb05a431258b6cd5d98f3 (patch)
treefc4a3dc073e4b24ecf43a297694fc6290ee27cec /lib/tftp.c
parent06d1b10cbefaa7c54c73e09df746ae79b7f14e14 (diff)
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
Diffstat (limited to 'lib/tftp.c')
-rw-r--r--lib/tftp.c10
1 files changed, 10 insertions, 0 deletions
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 <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;
}