wrowe 2003/10/16 15:13:03
Modified: . Tag: APR_0_9_BRANCH configure.in
include Tag: APR_0_9_BRANCH apr.h.in apr.hnw apr.hw
apr_network_io.h
include/arch/unix Tag: APR_0_9_BRANCH apr_arch_networkio.h
network_io/os2 Tag: APR_0_9_BRANCH sockopt.c
network_io/unix Tag: APR_0_9_BRANCH sockopt.c
network_io/win32 Tag: APR_0_9_BRANCH sockopt.c
Log:
Introduce apr_socket_atmark() with a more friendly failure case when the
SIOCATMARK symbol isn't available, to avoid breaking APR 0.9/httpd 2.0
distributions. [William Rowe, Jim Jagielski, Brian Havard and Jeff Trawick]
Revision Changes Path
No revision
No revision
1.535.2.1 +4 -0 apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.535
retrieving revision 1.535.2.1
diff -u -r1.535 -r1.535.2.1
--- configure.in 2 Sep 2003 08:42:54 -0000 1.535
+++ configure.in 16 Oct 2003 22:13:01 -0000 1.535.2.1
@@ -938,6 +938,7 @@
netinet/sctp.h \
netinet/sctp_uio.h \
sys/file.h \
+ sys/ioctl.h \
sys/mman.h \
sys/poll.h \
sys/resource.h \
@@ -946,6 +947,7 @@
sys/sendfile.h \
sys/signal.h \
sys/socket.h \
+ sys/sockio.h \
sys/stat.h \
sys/sysctl.h \
sys/syslimits.h \
@@ -992,9 +994,11 @@
AC_SUBST(stdlibh)
AC_SUBST(stringh)
AC_SUBST(stringsh)
+AC_SUBST(sys_ioctlh)
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)
No revision
No revision
1.124.2.1 +2 -0 apr/include/apr.h.in
Index: apr.h.in
===================================================================
RCS file: /home/cvs/apr/include/apr.h.in,v
retrieving revision 1.124
retrieving revision 1.124.2.1
diff -u -r1.124 -r1.124.2.1
--- apr.h.in 12 May 2003 10:49:42 -0000 1.124
+++ apr.h.in 16 Oct 2003 22:13:02 -0000 1.124.2.1
@@ -127,9 +127,11 @@
#define APR_HAVE_STDLIB_H @stdlibh@
#define APR_HAVE_STRING_H @stringh@
#define APR_HAVE_STRINGS_H @stringsh@
+#define APR_HAVE_SYS_IOCTL_H @sys_ioctlh@
#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.34.2.1 +1 -0 apr/include/apr.hnw
Index: apr.hnw
===================================================================
RCS file: /home/cvs/apr/include/apr.hnw,v
retrieving revision 1.34
retrieving revision 1.34.2.1
diff -u -r1.34 -r1.34.2.1
--- apr.hnw 15 Apr 2003 21:45:58 -0000 1.34
+++ apr.hnw 16 Oct 2003 22:13:02 -0000 1.34.2.1
@@ -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.115.2.1 +1 -0 apr/include/apr.hw
Index: apr.hw
===================================================================
RCS file: /home/cvs/apr/include/apr.hw,v
retrieving revision 1.115
retrieving revision 1.115.2.1
diff -u -r1.115 -r1.115.2.1
--- apr.hw 15 Apr 2003 22:28:13 -0000 1.115
+++ apr.hw 16 Oct 2003 22:13:02 -0000 1.115.2.1
@@ -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.141.2.1 +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.141
retrieving revision 1.141.2.1
diff -u -r1.141 -r1.141.2.1
--- apr_network_io.h 30 May 2003 02:26:31 -0000 1.141
+++ apr_network_io.h 16 Oct 2003 22:13:02 -0000 1.141.2.1
@@ -721,6 +721,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?
No revision
No revision
1.2.2.1 +6 -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.2.2.1
diff -u -r1.2 -r1.2.2.1
--- apr_arch_networkio.h 8 Jul 2003 12:53:10 -0000 1.2
+++ apr_arch_networkio.h 16 Oct 2003 22:13:02 -0000 1.2.2.1
@@ -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
@@ -110,6 +113,9 @@
#endif
#if APR_HAVE_SYS_SENDFILE_H
#include <sys/sendfile.h>
+#endif
+#if APR_HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
#endif
/* End System Headers */
No revision
No revision
1.33.2.1 +14 -0 apr/network_io/os2/sockopt.c
Index: sockopt.c
===================================================================
RCS file: /home/cvs/apr/network_io/os2/sockopt.c,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -u -r1.33 -r1.33.2.1
--- sockopt.c 24 Feb 2003 23:13:29 -0000 1.33
+++ sockopt.c 16 Oct 2003 22:13:02 -0000 1.33.2.1
@@ -170,6 +170,20 @@
}
+APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
+{
+ int oobmark;
+
+ if (ioctl(sock->socketdes, SIOCATMARK, (void*)&oobmark, sizeof(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)
{
No revision
No revision
1.70.2.1 +22 -0 apr/network_io/unix/sockopt.c
Index: sockopt.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/sockopt.c,v
retrieving revision 1.70
retrieving revision 1.70.2.1
diff -u -r1.70 -r1.70.2.1
--- sockopt.c 30 May 2003 12:50:40 -0000 1.70
+++ sockopt.c 16 Oct 2003 22:13:02 -0000 1.70.2.1
@@ -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... */
@@ -366,6 +367,27 @@
*on = apr_is_option_set(sock->netmask, opt);
}
return APR_SUCCESS;
+}
+
+
+apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
+{
+/* In 1.0 we rely on compile failure to assure all platforms grabbed
+ * the correct header file support for SIOCATMARK, but we don't want
+ * to fail the build of 0.9. Keep things good for the released branch.
+ */
+#ifdef SIOCATMARK
+ int oobmark;
+
+ if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
+ return apr_get_netos_error();
+
+ *atmark = (oobmark != 0);
+
+ return APR_SUCCESS;
+#else
+ return APR_ENOTIMPL;
+#endif
}
No revision
No revision
1.52.2.1 +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.52
retrieving revision 1.52.2.1
diff -u -r1.52 -r1.52.2.1
--- sockopt.c 24 Feb 2003 23:13:30 -0000 1.52
+++ sockopt.c 16 Oct 2003 22:13:03 -0000 1.52.2.1
@@ -276,6 +276,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)
{
|