summaryrefslogtreecommitdiffstats
path: root/c/src/libnetworking/lib/tftpDriver.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-12-13 17:03:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-12-13 17:03:37 +0000
commit809f445197d78174b88bc7bde434ea30eedbb464 (patch)
tree9a79d7ef5784459609c3f08b9bc5b5f4c4ea58fc /c/src/libnetworking/lib/tftpDriver.c
parentPatch from Eric Norum <eric@cls.usask.ca> to provide more network (diff)
downloadrtems-809f445197d78174b88bc7bde434ea30eedbb464.tar.bz2
Correction from Eric Norum for timeout in TFTP driver following bug
report by Nick.SIMON@syntegra.bt.co.uk: TFTP uses UDP and UDP packets are prime targets for getting dropped when the network gets busy. I want the number of retries quite large in my application. I see that PACKET_REPLY_MILLISECONDS is, in fact, not being used.
Diffstat (limited to '')
-rw-r--r--c/src/libnetworking/lib/tftpDriver.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/c/src/libnetworking/lib/tftpDriver.c b/c/src/libnetworking/lib/tftpDriver.c
index 369a23be67..ea3de5a901 100644
--- a/c/src/libnetworking/lib/tftpDriver.c
+++ b/c/src/libnetworking/lib/tftpDriver.c
@@ -305,8 +305,8 @@ getPacket (struct tftpStream *tp)
int len;
struct timeval tv;
- tv.tv_sec = 6;
- tv.tv_usec = 0;
+ tv.tv_sec = PACKET_REPLY_MILLISECONDS / 1000;
+ tv.tv_usec = (PACKET_REPLY_MILLISECONDS % 1000) * 1000;
setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
for (;;) {
union {
@@ -335,6 +335,7 @@ getPacket (struct tftpStream *tp)
sendStifle (tp, &from.i);
}
tv.tv_sec = 0;
+ tv.tv_usec = 0;
setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
return len;
}