diff --git a/lib/tftp.c b/lib/tftp.c index b582ab3194..f1ffd2a3ad 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; } diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index d9957f0302..e0007f4065 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -94,7 +94,7 @@ test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \ test1216 test1217 test1218 test1219 \ test1220 test1221 test1222 test1223 test1224 test1225 test1226 test1227 \ test1228 test1229 test1230 test1231 test1232 test1233 test1234 test1235 \ -test1236 test1237 \ +test1236 test1237 test1238 \ \ test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \ test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \ diff --git a/tests/data/test1238 b/tests/data/test1238 new file mode 100644 index 0000000000..18593398a0 --- /dev/null +++ b/tests/data/test1238 @@ -0,0 +1,49 @@ + + + +TFTP +TFTP RRQ + + + +# +# Server-side + + +writedelay: 1 + +# ~1200 bytes (so that they don't fit in two 512 byte chunks) + +012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 + + + +# +# Client-side + + +tftp + + +slow TFTP retrieve cancel due to -Y and -y + +# if less than 1000 bytes/sec within 2 seconds, abort! + +tftp://%HOSTIP:%TFTPPORT//1238 -Y1000 -y2 + + + +# +# Verify pseudo protocol after the test has been "shot" + + +opcode: 1 +filename: /1238 +mode: octet + +# 28 = CURLE_OPERATION_TIMEDOUT + +28 + + +