diff options
Diffstat (limited to 'plugins/FTPFileYM/curl/lib/tftp.c')
-rw-r--r-- | plugins/FTPFileYM/curl/lib/tftp.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/plugins/FTPFileYM/curl/lib/tftp.c b/plugins/FTPFileYM/curl/lib/tftp.c index ef740b8569..f1ffd2a3ad 100644 --- a/plugins/FTPFileYM/curl/lib/tftp.c +++ b/plugins/FTPFileYM/curl/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> @@ -947,10 +948,6 @@ static CURLcode tftp_connect(struct connectdata *conn, bool *done) blksize = TFTP_BLKSIZE_DEFAULT; - /* If there already is a protocol-specific struct allocated for this - sessionhandle, deal with it */ - Curl_reset_reqproto(conn); - state = conn->proto.tftpc = calloc(1, sizeof(tftp_state_data_t)); if(!state) return CURLE_OUT_OF_MEMORY; @@ -1259,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; } @@ -1307,14 +1313,6 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done) *done = FALSE; - /* - Since connections can be re-used between SessionHandles, this might be a - connection already existing but on a fresh SessionHandle struct so we must - make sure we have a good 'struct TFTP' to play with. For new connections, - the struct TFTP is allocated and setup in the tftp_connect() function. - */ - Curl_reset_reqproto(conn); - if(!conn->proto.tftpc) { code = tftp_connect(conn, done); if(code) |