diff -N -c -r -X exclude_files squid-1.0.beta7/src/comm.c squid-1.0.beta7.henrik/src/comm.c *** squid-1.0.beta7/src/comm.c Thu May 9 04:31:53 1996 --- squid-1.0.beta7.henrik/src/comm.c Sat May 18 19:14:14 1996 *************** *** 53,58 **** --- 53,63 ---- debug(5, 6, "comm_port: FD %d: sockaddr %u.\n", fd, addr.sin_addr.s_addr); fd_table[fd].port = ntohs(addr.sin_port); + if(fd_table[fd].port==0) { + debug(5, 1, "comm_port: Failed to retrieve TCP/UDP port number for socket: FD %d: got port 0\n", fd); + return (COMM_ERROR); + } + return fd_table[fd].port; } diff -N -c -r -X exclude_files squid-1.0.beta7/src/icp.c squid-1.0.beta7.henrik/src/icp.c *** squid-1.0.beta7/src/icp.c Thu May 9 04:31:58 1996 --- squid-1.0.beta7.henrik/src/icp.c Sat May 18 19:14:28 1996 *************** *** 434,440 **** debug(12, 4, "icpSendERROR: code %d: port %d: msg: '%s'\n", errorCode, port, msg); ! if (port == COMM_ERROR) { /* This file descriptor isn't bound to a socket anymore. * It probably timed out. */ debug(12, 2, "icpSendERROR: COMM_ERROR msg: %80.80s\n", msg); --- 434,440 ---- debug(12, 4, "icpSendERROR: code %d: port %d: msg: '%s'\n", errorCode, port, msg); ! if (port == COMM_ERROR || port == 0) { /* This file descriptor isn't bound to a socket anymore. * It probably timed out. */ debug(12, 2, "icpSendERROR: COMM_ERROR msg: %80.80s\n", msg);