From 809f445197d78174b88bc7bde434ea30eedbb464 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 13 Dec 1999 17:03:37 +0000 Subject: 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. --- c/src/libnetworking/lib/tftpDriver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'c/src/libnetworking/lib/tftpDriver.c') 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; } -- cgit v1.2.3