Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 76222 invoked from network); 15 Mar 2004 03:04:17 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 15 Mar 2004 03:04:17 -0000 Received: (qmail 96906 invoked by uid 500); 15 Mar 2004 03:03:59 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 96705 invoked by uid 500); 15 Mar 2004 03:03:58 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 96692 invoked from network); 15 Mar 2004 03:03:57 -0000 Message-ID: <1079319850.40551d2ad6b94@webmail.mydomain.com> Date: Sun, 14 Mar 2004 19:04:10 -0800 From: rbb@rkbloom.net To: dev@apr.apache.org MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 24.211.145.52 X-SA-Exim-Mail-From: rbb@rkbloom.net Subject: Timeout status codes are thoroughly messed up Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on calcium.dnsix.com X-Spam-Level: ** X-Spam-Status: No, hits=2.9 required=10.0 tests=NO_REAL_NAME, RCVD_IN_DYNABLOCK,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Report: * 0.3 NO_REAL_NAME From: does not include a real name * 2.5 RCVD_IN_DYNABLOCK RBL: Sent directly from dynamic IP address * [24.211.145.52 listed in dnsbl.sorbs.net] * 0.1 RCVD_IN_SORBS RBL: SORBS: sender is listed in SORBS * [24.211.145.52 listed in dnsbl.sorbs.net] X-SA-Exim-Version: 3.1 (built Thu Oct 23 13:26:47 PDT 2003) X-SA-Exim-Scanned: Yes X-uvscan-result: clean (1B2iN5-00034x-4B) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I have spent the last half hour or so trying to make the socket timeout tests pass on Windows. I couldn't make it happen, so I finally started reading through the code. It turns out that we have a number of error codes that mean that a timeout has expired. On any platform that uses wait_for_io_or_timeout, we return APR_TIMEUP to mean that the timeout popped. On Windows (and possibly others), we use APR_ETIMEDOUT. This leaves us needing to check two different macros (APR_STATUS_IS_TIMEUP and APR_STATUS_IS_ETIMEDOUT) to determine what is going on. I have currently left the test failing on Windows, rather than add the second check to the test. I specifically left it using APR_TIMEUP, because when I initially wrote the socket timeout code (lo those many years ago), I added that error code, so I know for a fact that APR_TIMEOUT predates APR_ETIMEDOUT. Also, a timeout popping isn't necessarily an error condition (hence the missing 'E' in APR_TIMEOUT), it just means that something you were expecting to happen hasn't happened yet. This needs to get resolved. I believe the fix is to simply add the correct checks to APR_STATUS_IS_TIMEUP, but I also would like to know if we really need to keep APR_STATUS_IS_ETIMEDOUT at all. Can we mark it deprecated? Ryan