diff options
-rw-r--r-- | lib/libstand/tftp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c index 5cb8762..b8da31a 100644 --- a/lib/libstand/tftp.c +++ b/lib/libstand/tftp.c @@ -443,11 +443,15 @@ sendrecv_tftp(d, sproc, sbuf, ssize, rproc, rbuf, rsize) continue; } +recvnext: /* Try to get a packet and process it. */ cc = (*rproc)(d, rbuf, rsize, tleft); /* Return on data, EOF or real error. */ if (cc != -1 || errno != 0) return (cc); + if ((getsecs() - t1) < tleft) { + goto recvnext; + } /* Timed out or didn't get the packet we're waiting for */ tleft += MINTMO; |