From 2c3413ae11349dc61e2146db1af1992b99aa974c Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Thu, 29 Jun 2000 12:02:59 +0000 Subject: [PATCH] Fix ICP-timeout bug 108577 --- SRC/ChangeLog | 7 ++++--- SRC/TODO | 1 - SRC/icp.c | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/SRC/ChangeLog b/SRC/ChangeLog index b3e8de8..49bbfc2 100644 --- a/SRC/ChangeLog +++ b/SRC/ChangeLog @@ -1,7 +1,8 @@ -echoping now uses a numbering scheme analog to the -Linux kernel one's. Even versions like 2.2 are stable (or supposed to), -odd versions like 2.1 are unstable, beta. +3.0.0 + * Autoconf/automake support + * Fix a bug in ICP timeout + 2.2.1 : Portability fixes diff --git a/SRC/TODO b/SRC/TODO index 1ed73b3..fabe266 100644 --- a/SRC/TODO +++ b/SRC/TODO @@ -3,7 +3,6 @@ machines exist. TCP timeout with long packets seem to confuse Cisco routers. -ICP always replies even when timeouting. Bug 108577 $Id$ diff --git a/SRC/icp.c b/SRC/icp.c index 1169133..bc03391 100644 --- a/SRC/icp.c +++ b/SRC/icp.c @@ -93,7 +93,12 @@ recv_icp (sockfd, buf, retcode) nr = recvfrom (sockfd, buf, DEFLINE, 0, (struct sockaddr *) 0, (int *) 0); - /* BUG: we should test the return code, see if there was a timeout, etc */ + if (nr < 0) { + if (timeout_flag) + err_quit ("Timeout while reading"); + else + err_sys ("No reply from ICP proxy server"); + } opcode = headerp->opcode; length = ntohs (headerp->length); sprintf (retcode, "ICP reply: \42%s\42", icp_op_code[opcode]);