Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 14555 invoked from network); 2 Oct 2006 07:06:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Oct 2006 07:06:28 -0000 Received: (qmail 385 invoked by uid 500); 2 Oct 2006 07:06:28 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 191 invoked by uid 500); 2 Oct 2006 07:06:27 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 180 invoked by uid 99); 2 Oct 2006 07:06:27 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 00:06:27 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [140.211.166.113] ([140.211.166.113:54624] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id A7/B1-16031-37AB0254 for ; Mon, 02 Oct 2006 00:06:27 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id E7F6D1A981A; Mon, 2 Oct 2006 00:06:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r451896 - /httpd/httpd/trunk/modules/proxy/proxy_util.c Date: Mon, 02 Oct 2006 07:06:24 -0000 To: cvs@httpd.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061002070624.E7F6D1A981A@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mturk Date: Mon Oct 2 00:06:24 2006 New Revision: 451896 URL: http://svn.apache.org/viewvc?view=rev&rev=451896 Log: Cleanup alternate is_connected method. It works for sure on win32,linux and solaris. I do not have access to other platforms so can not verify it works on them. Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?view=diff&rev=451896&r1=451895&r2=451896 ============================================================================== --- httpd/httpd/trunk/modules/proxy/proxy_util.c (original) +++ httpd/httpd/trunk/modules/proxy/proxy_util.c Mon Oct 2 00:06:24 2006 @@ -2074,7 +2074,10 @@ return OK; } -#if defined(WIN32) || defined(LINUX) +#if defined(WIN32) || defined(LINUX) || defined(SOLARIS2) +/* Tested platforms on which the alternative is_connected + * method works. + */ #define USE_ALTERNATE_IS_CONNECTED 1 #else #define USE_ALTERNATE_IS_CONNECTED 0 @@ -2101,9 +2104,9 @@ do { rc = select((int)sock + 1, &fd, NULL, NULL, &tv); -#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) +#ifdef _MSC_VER errno = WSAGetLastError() - WSABASEERR; -#endif +#endif } while (rc == -1 && errno == EINTR); if (rc == 0) { @@ -2111,22 +2114,17 @@ return 1; } else if (rc == 1) { -#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) +#ifdef _MSC_VER u_long nr; if (ioctlsocket(sock, FIONREAD, &nr) == 0) { - if (WSAGetLastError() == 0) - errno = 0; - else - errno = WSAGetLastError() - WSABASEERR; return nr == 0 ? 0 : 1; } - errno = WSAGetLastError() - WSABASEERR; #else int nr; if (ioctl(sock, FIONREAD, (void*)&nr) == 0) { return nr == 0 ? 0 : 1; } -#endif +#endif } return 0; }