httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@hyperreal.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/win32 sockopt.c
Date Tue, 01 Feb 2000 00:10:14 GMT
stoddard    00/01/31 16:10:13

  Modified:    src/lib/apr/network_io/win32 sockopt.c
  Log:
  Add code to set the socket timeout. Correct some error return codes.
  
  Revision  Changes    Path
  1.6       +12 -4     apache-2.0/src/lib/apr/network_io/win32/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockopt.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- sockopt.c	1999/10/25 23:55:23	1.5
  +++ sockopt.c	2000/02/01 00:10:12	1.6
  @@ -91,19 +91,27 @@
       else
           one = 0;
   
  +    if (opt & APR_SO_TIMEOUT) {
  +        int timeout = on * 1000;  /* Windows needs timeout in mSeconds */
  +        sock->timeout = timeout;
  +        if (setsockopt(sock->sock, SOL_SOCKET, SO_RCVTIMEO, (char*) &timeout, 
  +                       sizeof(timeout)) == SOCKET_ERROR) {
  +            return WSAGetLastError();
  +        }
  +    }
       if (opt & APR_SO_KEEPALIVE) {
           if (setsockopt(sock->sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one, sizeof(int))
== -1) {
  -            return APR_EEXIST;
  +            return WSAGetLastError();
           }
       }
       if (opt & APR_SO_DEBUG) {
           if (setsockopt(sock->sock, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int))
== -1) {
  -            return APR_EEXIST;
  +            return WSAGetLastError();
           }
       }
       if (opt & APR_SO_REUSEADDR) {
           if (setsockopt(sock->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int))
== -1) {
  -            return APR_EEXIST;
  +            return WSAGetLastError();
           }
       }
       if (opt & APR_SO_NONBLOCK) {
  @@ -124,7 +132,7 @@
           }
       }
       return APR_SUCCESS;
  -}         
  +}
   
   ap_status_t ap_gethostname(char *buf, int len, ap_context_t *cont)
   {
  
  
  

Mime
View raw message