apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/network_io/win32 sockopt.c
Date Tue, 14 Oct 2003 23:47:29 GMT
wrowe       2003/10/14 16:47:29

  Modified:    .        configure.in
               include  apr.h.in apr.hnw apr.hw apr_network_io.h
               include/arch/unix apr_arch_networkio.h
               network_io/os2 sockopt.c
               network_io/unix sockopt.c
               network_io/win32 sockopt.c
  Log:
    Implement apr_socket_atmark, similar to socket_atmark except 1) it's
    portable, and 2) the return value is passed by a boolean (int) ref,
    with errors returned as an apr_status_t.
  
    The question is, how portable?  sys/sockio.h seems sufficent for me
    on hp/ux, solaris, linux, osx, and this works on Win32.  The Netware
    and OS2 implementations are best guesses.
  
  Submitted by: Jim Jagielski and William Rowe
  
  Revision  Changes    Path
  1.544     +2 -0      apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.543
  retrieving revision 1.544
  diff -u -r1.543 -r1.544
  --- configure.in	1 Oct 2003 21:08:16 -0000	1.543
  +++ configure.in	14 Oct 2003 23:47:29 -0000	1.544
  @@ -939,6 +939,7 @@
       sys/sendfile.h	\
       sys/signal.h	\
       sys/socket.h	\
  +    sys/sockio.h	\
       sys/stat.h          \
       sys/sysctl.h	\
       sys/syslimits.h	\
  @@ -988,6 +989,7 @@
   AC_SUBST(sys_sendfileh)
   AC_SUBST(sys_signalh)
   AC_SUBST(sys_socketh)
  +AC_SUBST(sys_sockioh)
   AC_SUBST(sys_typesh)
   AC_SUBST(sys_timeh)
   AC_SUBST(sys_uioh)
  
  
  
  1.128     +1 -0      apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.h.in,v
  retrieving revision 1.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- apr.h.in	1 Oct 2003 21:08:16 -0000	1.127
  +++ apr.h.in	14 Oct 2003 23:47:29 -0000	1.128
  @@ -130,6 +130,7 @@
   #define APR_HAVE_SYS_SENDFILE_H  @sys_sendfileh@
   #define APR_HAVE_SYS_SIGNAL_H    @sys_signalh@
   #define APR_HAVE_SYS_SOCKET_H    @sys_socketh@
  +#define APR_HAVE_SYS_SOCKIO_H    @sys_sockioh@
   #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@
   #define APR_HAVE_SYS_TIME_H      @sys_timeh@
   #define APR_HAVE_SYS_TYPES_H     @sys_typesh@
  
  
  
  1.37      +1 -0      apr/include/apr.hnw
  
  Index: apr.hnw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hnw,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- apr.hnw	1 Oct 2003 21:08:16 -0000	1.36
  +++ apr.hnw	14 Oct 2003 23:47:29 -0000	1.37
  @@ -143,6 +143,7 @@
   #define APR_HAVE_SYS_SENDFILE_H 0
   #define APR_HAVE_SYS_SIGNAL_H   0
   #define APR_HAVE_SYS_SOCKET_H   0
  +#define APR_HAVE_SYS_SOCKIO_H   0
   #define APR_HAVE_SYS_SYSLIMITS_H 0
   #define APR_HAVE_SYS_TIME_H     0
   #define APR_HAVE_SYS_TYPES_H    1
  
  
  
  1.118     +1 -0      apr/include/apr.hw
  
  Index: apr.hw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hw,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- apr.hw	1 Oct 2003 21:08:16 -0000	1.117
  +++ apr.hw	14 Oct 2003 23:47:29 -0000	1.118
  @@ -171,6 +171,7 @@
   #define APR_HAVE_SYS_SENDFILE_H 0
   #define APR_HAVE_SYS_SIGNAL_H   0
   #define APR_HAVE_SYS_SOCKET_H   0
  +#define APR_HAVE_SYS_SOCKIO_H   0
   #define APR_HAVE_SYS_SYSLIMITS_H 0
   #define APR_HAVE_SYS_TIME_H     0
   #define APR_HAVE_SYS_TYPES_H    1
  
  
  
  1.147     +9 -0      apr/include/apr_network_io.h
  
  Index: apr_network_io.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_network_io.h,v
  retrieving revision 1.146
  retrieving revision 1.147
  diff -u -r1.146 -r1.147
  --- apr_network_io.h	1 Oct 2003 13:19:43 -0000	1.146
  +++ apr_network_io.h	14 Oct 2003 23:47:29 -0000	1.147
  @@ -662,6 +662,15 @@
                                                    apr_interval_time_t *t);
   
   /**
  + * Query the specified socket if at the OOB/Urgent data mark
  + * @param sock The socket to query
  + * @param atmark Is set to true if socket is at the OOB/urgent mark,
  + *               otherwise is set to false.
  + */
  +APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, 
  +                                            int *atmark);
  +
  +/**
    * Return an apr_sockaddr_t from an apr_socket_t
    * @param sa The returned apr_sockaddr_t.
    * @param which Which interface do we want the apr_sockaddr_t for?
  
  
  
  1.3       +3 -0      apr/include/arch/unix/apr_arch_networkio.h
  
  Index: apr_arch_networkio.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/apr_arch_networkio.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_arch_networkio.h	8 Jul 2003 12:53:10 -0000	1.2
  +++ apr_arch_networkio.h	14 Oct 2003 23:47:29 -0000	1.3
  @@ -102,6 +102,9 @@
   #if APR_HAVE_SYS_SOCKET_H
   #include <sys/socket.h>
   #endif
  +#if APR_HAVE_SYS_SOCKIO_H
  +#include <sys/sockio.h>
  +#endif
   #if APR_HAVE_NETDB_H
   #include <netdb.h>
   #endif
  
  
  
  1.35      +13 -0     apr/network_io/os2/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/os2/sockopt.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- sockopt.c	3 Sep 2003 16:31:47 -0000	1.34
  +++ sockopt.c	14 Oct 2003 23:47:29 -0000	1.35
  @@ -156,6 +156,19 @@
   }
   
   
  +APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
  +{
  +    int oobmark;
  +
  +    if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
  +        return APR_OS2_STATUS(sock_errno());;
  +
  +    *atmark = (oobmark != 0);
  +
  +    return APR_SUCCESS;
  +}
  +
  +
   APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len, 
                                             apr_pool_t *cont)
   {
  
  
  
  1.72      +14 -0     apr/network_io/unix/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockopt.c,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- sockopt.c	3 Sep 2003 16:31:47 -0000	1.71
  +++ sockopt.c	14 Oct 2003 23:47:29 -0000	1.72
  @@ -55,6 +55,7 @@
   #include "apr_arch_networkio.h"
   #include "apr_strings.h"
   
  +
   static apr_status_t soblock(int sd)
   {
   /* BeOS uses setsockopt at present for non blocking... */
  @@ -365,6 +366,19 @@
           default:
               *on = apr_is_option_set(sock->netmask, opt);
       }
  +    return APR_SUCCESS;
  +}
  +
  +
  +apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
  +{
  +    int oobmark;
  +
  +    if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
  +        return apr_get_netos_error();
  +
  +    *atmark = (oobmark != 0);
  +
       return APR_SUCCESS;
   }
   
  
  
  
  1.54      +13 -0     apr/network_io/win32/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/win32/sockopt.c,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- sockopt.c	3 Sep 2003 16:31:47 -0000	1.53
  +++ sockopt.c	14 Oct 2003 23:47:29 -0000	1.54
  @@ -262,6 +262,19 @@
   }
   
   
  +APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
  +{
  +    u_long oobmark;
  +
  +    if (ioctlsocket(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
  +        return apr_get_netos_error();
  +
  +    *atmark = (oobmark != 0);
  +
  +    return APR_SUCCESS;
  +}
  +
  +
   APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len,
                                             apr_pool_t *cont)
   {
  
  
  

Mime
View raw message