httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Nicholls <gnicho...@level8.com>
Subject [PATCH] win32/sockets.c - remove select in connect routine
Date Fri, 15 Sep 2000 20:20:59 GMT
 This patch removes the select from the win32/sockets.c connect routine. It will now permit
a
non-blocking connect.

---------------- cut here -------------------------------------------
Index: sockets.c
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/lib/apr/network_io/win32/sockets.c,v
retrieving revision 1.37
diff -u -d -p -r1.37 sockets.c
--- sockets.c   2000/08/06 06:07:24     1.37
+++ sockets.c   2000/09/15 20:09:43
@@ -215,8 +215,6 @@ apr_status_t apr_accept(apr_socket_t **n
 apr_status_t apr_connect(apr_socket_t *sock, char *hostname)
 {
     struct hostent *hp;
-    int lasterror;
-    fd_set temp;

     if ((sock->sock == INVALID_SOCKET) || (!sock->local_addr)) {
         return APR_ENOTSOCK;
@@ -241,16 +239,7 @@ apr_status_t apr_connect(apr_socket_t *s

     if (connect(sock->sock, (const struct sockaddr *)sock->remote_addr,
                 sock->addr_len) == SOCKET_ERROR) {
-        lasterror = WSAGetLastError();
-        if (lasterror != WSAEWOULDBLOCK) {
-            return lasterror;
-        }
-        /* wait for the connect to complete */
-        FD_ZERO(&temp);
-        FD_SET(sock->sock, &temp);
-        if (select(sock->sock+1, NULL, &temp, NULL, NULL) == SOCKET_ERROR) {
-            return WSAGetLastError();
-        }
+      return WSAGetLastError();
     }
     /* connect was OK .. amazing */
     if (sock->local_addr->sin_port == 0) {




Mime
View raw message