apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: apr/network_io/win32 sockopt.c
Date Thu, 09 Aug 2001 23:26:18 GMT
bnicholes    01/08/09 16:26:18

  Modified:    network_io/win32 sockopt.c
  Log:
  Implemented apr_getsocketopt() for NetWare
  
  Revision  Changes    Path
  1.35      +36 -0     apr/network_io/win32/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/win32/sockopt.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- sockopt.c	2001/08/06 15:57:29	1.34
  +++ sockopt.c	2001/08/09 23:26:18	1.35
  @@ -173,6 +173,9 @@
   APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock,
                                              apr_int32_t opt, apr_int32_t *on)
   {
  +#ifdef NETWARE
  +    int sol_opt = 0;
  +
       switch (opt) {
       case APR_SO_TIMEOUT: 
           /* Convert from milliseconds (windows units) to microseconds 
  @@ -183,6 +186,38 @@
           *on = sock->disconnected;
           break;
       case APR_SO_KEEPALIVE:
  +        sol_opt = SO_KEEPALIVE;
  +        break;
  +    case APR_SO_DEBUG:
  +        sol_opt = SO_DEBUG;
  +        break;
  +    case APR_SO_REUSEADDR:
  +        sol_opt = SO_REUSEADDR;
  +        break;
  +    case APR_SO_NONBLOCK:
  +    case APR_SO_LINGER:
  +    default:
  +        return APR_ENOTIMPL;
  +        break;
  +    }
  +    if (sol_opt) {
  +        int sz = sizeof(apr_int32_t);
  +
  +        if (getsockopt(sock->sock, SOL_SOCKET, sol_opt, (char *)on, &sz) == -1)
{
  +            return apr_get_netos_error();
  +        }
  +    }
  +#else
  +    switch (opt) {
  +    case APR_SO_TIMEOUT: 
  +        /* Convert from milliseconds (windows units) to microseconds 
  +         * (APR units) */
  +        *on = (apr_int32_t)(sock->timeout * 1000);
  +        break;
  +    case APR_SO_DISCONNECTED:
  +        *on = sock->disconnected;
  +        break;
  +    case APR_SO_KEEPALIVE:
       case APR_SO_DEBUG:
       case APR_SO_REUSEADDR:
       case APR_SO_NONBLOCK:
  @@ -191,6 +226,7 @@
           return APR_ENOTIMPL;
           break;
       }
  +#endif
       return APR_SUCCESS;
   }
   
  
  
  

Mime
View raw message