TFTP: let tftp_multi_statemach()'s return codes through
authorJames Dury <purplepolecat@users.sf.net>
Sat, 7 Dec 2013 14:53:08 +0000 (15:53 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 7 Dec 2013 14:53:08 +0000 (15:53 +0100)
It would otherwise always clobber the return code with new function
calls and it couldn't return timeout etc.

Bug: http://curl.haxx.se/bug/view.cgi?id=1310

lib/tftp.c

index f1ffd2a3ad0ebf5211e57ca0131b35ac6f669f58..04e8fa79836ca427472b3682f5e4620b748b0230 100644 (file)
@@ -1256,7 +1256,7 @@ static CURLcode tftp_doing(struct connectdata *conn, bool *dophase_done)
   if(*dophase_done) {
     DEBUGF(infof(conn->data, "DO phase is complete\n"));
   }
-  else {
+  else if(!result) {
     /* 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. */