Bugfix, wastn retrieving last block, patch by Jean-Christophe Dubois
authorGlenn L McGrath <bug1@ihug.co.nz>
Thu, 19 Dec 2002 20:16:22 +0000 (20:16 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Thu, 19 Dec 2002 20:16:22 +0000 (20:16 -0000)
networking/tftp.c

index a3808f5bfcd5f646aaeebf21a0adb682381a83d1..378ba2feff0d4daaf141db2a53048f0053b7b866 100644 (file)
@@ -279,8 +279,6 @@ static inline int tftp(const int cmd, const struct hostent *host,
                                }
 
                                cp += len;
-                       } else if (finished) {
-                               break;
                        }
                }
 
@@ -306,8 +304,11 @@ static inline int tftp(const int cmd, const struct hostent *host,
                        }
 
 
-                       /* receive packet */
+                       if (finished) {
+                               break;
+                       }
 
+                       /* receive packet */
 
                        memset(&from, 0, sizeof(from));
                        fromlen = sizeof(from);
@@ -359,7 +360,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
 
                } while (timeout && (len >= 0));
 
-               if (len < 0) {
+               if ((finished) || (len < 0)) {
                        break;
                }