httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/unix sockets.c sockopt.c
Date Sat, 18 Nov 2000 16:31:52 GMT
dreid       00/11/18 08:31:52

  Modified:    src/lib/apr/network_io/unix sockets.c sockopt.c
  Log:
  Some more small cahnges that allow BeOS to use the Unix code for
  most of the networking.
  
  Revision  Changes    Path
  1.60      +4 -0      apache-2.0/src/lib/apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockets.c,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- sockets.c	2000/11/18 15:46:45	1.59
  +++ sockets.c	2000/11/18 16:31:52	1.60
  @@ -61,7 +61,11 @@
   #ifndef BEOS
       if (close(thesocket->socketdes) == 0) {
   #else
  +#ifndef BEOS_BONE
       if (closesocket(thesocket->socketdes) == 0) {
  +#else
  +    if (close(thesocket->socketdes) == 0) {
  +#endif
   #endif
           thesocket->socketdes = -1;
           return APR_SUCCESS;
  
  
  
  1.39      +22 -2     apache-2.0/src/lib/apr/network_io/unix/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockopt.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- sockopt.c	2000/11/18 15:46:45	1.38
  +++ sockopt.c	2000/11/18 16:31:52	1.39
  @@ -113,18 +113,20 @@
   apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
   {
       int one;
  -    struct linger li;
       apr_status_t stat;
   
       if (on)
           one = 1;
       else
           one = 0;
  -
       if (opt & APR_SO_KEEPALIVE) {
  +#ifdef SO_KEEPALIVE
           if (setsockopt(sock->socketdes, SOL_SOCKET, SO_KEEPALIVE, (void *)&one,
sizeof(int)) == -1) {
               return errno;
           }
  +#else
  +        return APR_ENOTIMPL;
  +#endif
       }
       if (opt & APR_SO_DEBUG) {
           if (setsockopt(sock->socketdes, SOL_SOCKET, SO_DEBUG, (void *)&one, sizeof(int))
== -1) {
  @@ -137,9 +139,13 @@
           }
       }
       if (opt & APR_SO_SNDBUF) {
  +#ifdef SO_SNDBUF
           if (setsockopt(sock->socketdes, SOL_SOCKET, SO_SNDBUF, (void *)&on, sizeof(int))
== -1) {
               return errno;
           }
  +#else
  +        return APR_ENOTIMPL;
  +#endif
       }
       if (opt & APR_SO_NONBLOCK) {
           if (on) {
  @@ -152,11 +158,16 @@
           }
       }
       if (opt & APR_SO_LINGER) {
  +#ifdef SO_LINGER
  +        struct linger li;
           li.l_onoff = on;
           li.l_linger = MAX_SECS_TO_LINGER;
           if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct
linger)) == -1) {
               return errno;
           }
  +#else
  +        return APR_ENOTIMPL;
  +#endif
       }
       if (opt & APR_SO_TIMEOUT) { 
           /* don't do the fcntl foo more than needed */ 
  @@ -176,6 +187,15 @@
               return errno;
           }
   #else
  +        /* BeOS pre-BONE has TCP_NODELAY set by default.
  +         * As it can't be turned off we might as well check if they're asking
  +         * for it to be turned on!
  +         */
  +#ifdef BEOS
  +        if (on == 1)
  +            return APR_SUCCESS;
  +        else
  +#endif
           return APR_ENOTIMPL;
   #endif
       }
  
  
  

Mime
View raw message