httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r451896 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Date Mon, 02 Oct 2006 07:06:24 GMT
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;
 }



Mime
View raw message