apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject [PATCH] APR Socket IOL
Date Thu, 08 Nov 2001 15:32:45 GMT
This patch is a first rough implementation of a socket iol in APR (from discussions with
Sander Striker a few months back).

Public API Changes:
No new APIs were created.
apr_socket_create() has an extra parameter, a pointer to an apr_socket_iol_t.

New Public Structures:
apr_socket_iol_t - contains pointers to callback functions.

Usage:
If you do not want to redirect socket calls and just use existing APR calls, use
apr_socket_create() thusly:
apr_socket_create(&new_sock, APR_INET, SOCKSTREAM, NULL, r->pool);


If you want to redirect socket calls:

/* Set up apr_socket_iol_t with pointers to specific calls you
 * want to redirect
 */
apr_socket_iol_t *iol;
iol = apr_pcalloc(r->pool, sizeof(*iol));
iol->iol_socket_shutdown = pointer_to_your_shutdown_function;
iol->iol_socket_read = pointer_to_your_read_function;
iol->iol_socket_write = pointer_to_your_write_function;
...
...
apr_socket_create(&new_sock, APR_INET, SOCKSTREAM, iol, r->pool);

Comments:
This patch implements a single cross platform entry point for all the apr_socket_* calls
(see network_io/unix/aprsocketapi.c). Most of the code in this patch is accounting for
this.

I have tested this on Windows. I started modifying code in the Unix branch but it is
surely is broken.Haven't made any effort on the other network_io OS specific branches.

Comments?

Bill

Index: modules/proxy/proxy_connect.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_connect.c,v
retrieving revision 1.50
diff -u -r1.50 proxy_connect.c
--- modules/proxy/proxy_connect.c 2001/08/20 16:49:29 1.50
+++ modules/proxy/proxy_connect.c 2001/11/08 14:33:32
@@ -216,7 +216,7 @@
     }

     /* create a new socket */
-    if ((rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, r->pool)) != APR_SUCCESS)
{
+    if ((rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, NULL, r->pool)) !=
APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
             "proxy: error creating socket");
         return HTTP_INTERNAL_SERVER_ERROR;
Index: modules/proxy/proxy_ftp.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_ftp.c,v
retrieving revision 1.81
diff -u -r1.81 proxy_ftp.c
--- modules/proxy/proxy_ftp.c 2001/10/08 19:25:35 1.81
+++ modules/proxy/proxy_ftp.c 2001/11/08 14:33:33
@@ -673,7 +673,7 @@
     }


-    if ((rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, r->pool)) != APR_SUCCESS)
{
+    if ((rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, NULL, r->pool)) !=
APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                       "proxy: FTP: error creating socket");
         return HTTP_INTERNAL_SERVER_ERROR;
@@ -1041,7 +1041,7 @@
                              "proxy: FTP: EPSV contacting remote host on port %d",
                              remote_port);

-  if ((rv = apr_socket_create(&remote_sock, APR_INET, SOCK_STREAM, r->pool)) !=
APR_SUCCESS) {
+  if ((rv = apr_socket_create(&remote_sock, APR_INET, SOCK_STREAM, NULL, r->pool))
!=
APR_SUCCESS) {
       ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
              "proxy: FTP: error creating EPSV socket");
       return HTTP_INTERNAL_SERVER_ERROR;
@@ -1135,7 +1135,7 @@
                              "proxy: FTP: PASV contacting host %d.%d.%d.%d:%d",
                              h3, h2, h1, h0, pasvport);

-  if ((rv = apr_socket_create(&remote_sock, APR_INET, SOCK_STREAM, r->pool)) !=
APR_SUCCESS) {
+  if ((rv = apr_socket_create(&remote_sock, APR_INET, SOCK_STREAM, NULL, r->pool))
!=
APR_SUCCESS) {
       ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
              "proxy: error creating PASV socket");
       return HTTP_INTERNAL_SERVER_ERROR;
@@ -1177,7 +1177,7 @@
  apr_port_t local_port;
  unsigned int h0, h1, h2, h3, p0, p1;

- if ((rv = apr_socket_create(&local_sock, APR_INET, SOCK_STREAM, r->pool)) !=
APR_SUCCESS) {
+ if ((rv = apr_socket_create(&local_sock, APR_INET, SOCK_STREAM, NULL, r->pool)) !=
APR_SUCCESS) {
      ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
     "proxy: FTP: error creating local socket");
      return HTTP_INTERNAL_SERVER_ERROR;
Index: modules/proxy/proxy_http.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_http.c,v
retrieving revision 1.106
diff -u -r1.106 proxy_http.c
--- modules/proxy/proxy_http.c 2001/11/05 23:06:55 1.106
+++ modules/proxy/proxy_http.c 2001/11/08 14:33:33
@@ -342,7 +342,7 @@
         backend->connection = NULL;

         /* see memory note above */
-        if ((rv = apr_socket_create(&p_conn->sock, APR_INET, SOCK_STREAM,
+        if ((rv = apr_socket_create(&p_conn->sock, APR_INET, SOCK_STREAM, NULL,
                                     c->pool)) != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                          "proxy: error creating socket");
Index: server/listen.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/listen.c,v
retrieving revision 1.63
diff -u -r1.63 listen.c
--- server/listen.c 2001/10/16 18:45:15 1.63
+++ server/listen.c 2001/11/08 14:33:33
@@ -191,7 +191,7 @@
     if (default_family == APR_UNSPEC) {
         apr_socket_t *tmp_sock;

-        if (apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM,
+        if (apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM, NULL,
                               p) == APR_SUCCESS) {
             apr_socket_close(tmp_sock);
             default_family = APR_INET6;
@@ -254,7 +254,7 @@
         return;
     }
     if ((status = apr_socket_create(&new->sd, new->bind_addr->sa.sin.sin_family,
-                                    SOCK_STREAM, process->pool)) != APR_SUCCESS) {
+                                    SOCK_STREAM, NULL, process->pool)) != APR_SUCCESS)
{
         ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool,
                      "alloc_listener: failed to get a socket for %s", addr);
         return;
Index: server/rfc1413.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/rfc1413.c,v
retrieving revision 1.43
diff -u -r1.43 rfc1413.c
--- server/rfc1413.c 2001/10/22 13:04:12 1.43
+++ server/rfc1413.c 2001/11/08 14:33:34
@@ -141,7 +141,7 @@

     if ((rv = apr_socket_create(newsock,
                                 localsa->sa.sin.sin_family, /* has to match */
-                                SOCK_STREAM, conn->pool)) != APR_SUCCESS) {
+                                SOCK_STREAM, NULL, conn->pool)) != APR_SUCCESS) {
  ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv,
                      "rfc1413: error creating query socket");
         return rv;
Index: srclib/apr/apr.dsp
===================================================================
RCS file: /home/cvs/apr/apr.dsp,v
retrieving revision 1.86
diff -u -r1.86 apr.dsp
--- srclib/apr/apr.dsp 2001/09/28 14:05:22 1.86
+++ srclib/apr/apr.dsp 2001/11/08 14:33:34
@@ -101,10 +101,6 @@
 # End Source File
 # Begin Source File

-SOURCE=.\file_io\unix\mktemp.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\file_io\unix\fileacc.c
 # End Source File
 # Begin Source File
@@ -133,6 +129,10 @@
 # End Source File
 # Begin Source File

+SOURCE=.\file_io\unix\mktemp.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\file_io\win32\open.c
 # End Source File
 # Begin Source File
@@ -240,6 +240,10 @@
 # Begin Group "network_io"

 # PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\network_io\unix\aprsockapi.c
+# End Source File
 # Begin Source File

 SOURCE=.\network_io\unix\inet_ntop.c
Index: srclib/apr/libapr.dsp
===================================================================
RCS file: /home/cvs/apr/libapr.dsp,v
retrieving revision 1.46
diff -u -r1.46 libapr.dsp
--- srclib/apr/libapr.dsp 2001/09/28 14:05:23 1.46
+++ srclib/apr/libapr.dsp 2001/11/08 14:33:34
@@ -244,6 +244,10 @@
 # PROP Default_Filter ""
 # Begin Source File

+SOURCE=.\network_io\unix\aprsockapi.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\network_io\unix\inet_ntop.c
 # End Source File
 # Begin Source File
Index: srclib/apr/include/apr_network_io.h
===================================================================
RCS file: /home/cvs/apr/include/apr_network_io.h,v
retrieving revision 1.111
diff -u -r1.111 apr_network_io.h
--- srclib/apr/include/apr_network_io.h 2001/08/15 21:02:53 1.111
+++ srclib/apr/include/apr_network_io.h 2001/11/08 14:33:34
@@ -185,6 +185,7 @@
 #endif

 typedef struct apr_socket_t     apr_socket_t;
+typedef struct apr_socket_iol_t apr_socket_iol_t;
 typedef struct apr_pollfd_t     apr_pollfd_t;
 /**
  * A structure to encapsulate headers and trailers for apr_sendfile
@@ -279,7 +280,8 @@
  */
 APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock,
                                             int family, int type,
-                                            apr_pool_t *cont);
+                                            apr_socket_iol_t *iol,
+                                            apr_pool_t *p);

 /**
  * Shutdown either reading, writing, or both sides of a tcp socket.
@@ -814,6 +816,117 @@
  */
 APR_DECLARE(void) apr_socket_unset_inherit(apr_socket_t *skt);

+
+/*
+ * Socket IOL
+ */
+
+
+typedef apr_status_t (*apr_socket_create_fn_t) (apr_socket_t **new_sock,
+                                                int family, int type,
+                                                apr_pool_t *p);
+typedef apr_status_t (*apr_shutdown_fn_t) (apr_socket_t *thesocket,
+                                           apr_shutdown_how_e how);
+typedef apr_status_t (*apr_socket_close_fn_t) (apr_socket_t *thesocket);
+typedef apr_status_t (*apr_bind_fn_t) (apr_socket_t *sock, apr_sockaddr_t *sa);
+typedef apr_status_t (*apr_listen_fn_t) (apr_socket_t *sock, apr_int32_t backlog);
+typedef apr_status_t (*apr_accept_fn_t) (apr_socket_t **new_sock,
+                                         apr_socket_t *sock,
+                                         apr_pool_t *connection_pool);
+typedef apr_status_t (*apr_connect_fn_t) (apr_socket_t *sock, apr_sockaddr_t *sa);
+typedef apr_status_t (*apr_socket_data_get_fn_t) (void **data, const char *key,
+                                                  apr_socket_t *sock);
+typedef apr_status_t (*apr_socket_data_set_fn_t) (apr_socket_t *sock, void *data,
+                                                  const char *key,
+                                                  apr_status_t (*cleanup)(void*));
+typedef apr_status_t (*apr_send_fn_t) (apr_socket_t *sock, const char *buf,
+                                       apr_size_t *len);
+typedef apr_status_t (*apr_sendv_fn_t) (apr_socket_t *sock,
+                                        const struct iovec *vec,
+                                        apr_int32_t nvec, apr_size_t *len);
+typedef apr_status_t (*apr_sendto_fn_t) (apr_socket_t *sock, apr_sockaddr_t *where,
+                                         apr_int32_t flags, const char *buf,
+                                         apr_size_t *len);
+typedef apr_status_t (*apr_recvfrom_fn_t) (apr_sockaddr_t *from, apr_socket_t *sock,
+                                           apr_int32_t flags, char *buf,
+                                           apr_size_t *len);
+#if APR_HAS_SENDFILE
+typedef apr_status_t (*apr_sendfile_fn_t) (apr_socket_t *sock, apr_file_t *file,
+                                           apr_hdtr_t *hdtr, apr_off_t *offset,
+                                           apr_size_t *len, apr_int32_t flags);
+#endif /* APR_HAS_SENDFILE */
+typedef apr_status_t (*apr_recv_fn_t) (apr_socket_t *sock,
+                                       char *buf, apr_size_t *len);
+typedef apr_status_t (*apr_setsocketopt_fn_t) (apr_socket_t *sock,
+                                               apr_int32_t opt, apr_int32_t on);
+typedef apr_status_t (*apr_getsocketopt_fn_t) (apr_socket_t *sock,
+                                               apr_int32_t opt, apr_int32_t *on);
+typedef apr_status_t (*apr_socket_addr_get_fn_t) (apr_sockaddr_t **sa,
+                                                  apr_interface_e which,
+                                                  apr_socket_t *sock);
+typedef apr_status_t (*apr_poll_socket_add_fn_t) (apr_pollfd_t *aprset,
+                                                  apr_socket_t *sock,
+                                                  apr_int16_t event);
+typedef apr_status_t (*apr_poll_socket_mask_fn_t) (apr_pollfd_t *aprset,
+                                                   apr_socket_t *sock,
+                                                   apr_int16_t events);
+typedef apr_status_t (*apr_poll_socket_remove_fn_t) (apr_pollfd_t *aprset,
+                                                     apr_socket_t *sock);
+typedef apr_status_t (*apr_poll_socket_clear_fn_t) (apr_pollfd_t *aprset,
+                                                    apr_int16_t events);
+typedef apr_status_t (*apr_poll_revents_get_fn_t) (apr_int16_t *event,
+                                                   apr_socket_t *sock,
+                                                   apr_pollfd_t *aprset);
+#if APR_FILES_AS_SOCKETS
+typedef apr_status_t (*apr_socket_from_file_fn_t) (apr_socket_t **newsock,
+                                                   apr_file_t *file);
+#endif /* APR_FILES_AS_SOCKETS */
+typedef void (*apr_socket_set_inherit_fn_t) (apr_socket_t *sock);
+typedef void (*apr_socket_unset_inherit_fn_t) (apr_socket_t *sock);
+#if APR_HAS_SO_ACCEPTFILTER
+typedef apr_status_t (*apr_socket_accept_filter_fn_t) (apr_socket_t *sock, char *name,
+                                      char *args);
+#endif
+
+
+struct apr_socket_iol_t
+{
+    apr_socket_create_fn_t        iol_socket_create;
+    apr_shutdown_fn_t             iol_socket_shutdown;
+    apr_socket_close_fn_t         iol_socket_close;
+    apr_bind_fn_t                 iol_socket_bind;
+    apr_listen_fn_t               iol_socket_listen;
+    apr_accept_fn_t               iol_socket_accept;
+    apr_connect_fn_t              iol_socket_connect;
+    apr_socket_data_get_fn_t      iol_socket_data_get;
+    apr_socket_data_set_fn_t      iol_socket_data_set;
+    apr_send_fn_t                 iol_socket_send;
+    apr_sendv_fn_t                iol_socket_sendv;
+    apr_sendto_fn_t               iol_socket_sendto;
+    apr_recvfrom_fn_t             iol_socket_recvfrom;
+#if APR_HAS_SENDFILE
+    apr_sendfile_fn_t             iol_socket_sendfile;
+#endif /* APR_HAS_SENDFILE */
+    apr_recv_fn_t                 iol_socket_recv;
+    apr_setsocketopt_fn_t         iol_socket_setsocketopt;
+    apr_getsocketopt_fn_t         iol_socket_getsocketopt;
+    apr_socket_addr_get_fn_t      iol_socket_addr_get;
+
+    /* Poll socket calls */
+    apr_poll_socket_add_fn_t      iol_socket_poll_socket_add;
+    apr_poll_socket_mask_fn_t     iol_socket_poll_socket_mask;
+    apr_poll_socket_remove_fn_t   iol_socket_poll_socket_remove;
+    apr_poll_socket_clear_fn_t    iol_socket_poll_socket_clear;
+    apr_poll_revents_get_fn_t     iol_socket_poll_revents_get;
+    apr_socket_set_inherit_fn_t   iol_socket_set_inherit;
+    apr_socket_unset_inherit_fn_t iol_socket_unset_inherit;
+#if APR_HAS_SO_ACCEPTFILTER
+    apr_socket_accept_filter_fn_t iol_socket_accept_filter;
+#endif
+#if APR_FILES_AS_SOCKETS
+    apr_socket_from_file_fn_t     iol_socket_from_file;
+#endif /* APR_FILES_AS_SOCKETS */
+};
 #ifdef __cplusplus
 }
 #endif
Index: srclib/apr/include/arch/unix/networkio.h
===================================================================
RCS file: /home/cvs/apr/include/arch/unix/networkio.h,v
retrieving revision 1.48
diff -u -r1.48 networkio.h
--- srclib/apr/include/arch/unix/networkio.h 2001/07/16 20:36:59 1.48
+++ srclib/apr/include/arch/unix/networkio.h 2001/11/08 14:33:34
@@ -136,6 +136,7 @@
     int local_interface_unknown;
     apr_int32_t netmask;
     apr_int32_t inherit;
+    apr_socket_iol_t *iol;
 };

 struct apr_pollfd_t {
Index: srclib/apr/include/arch/win32/networkio.h
===================================================================
RCS file: /home/cvs/apr/include/arch/win32/networkio.h,v
retrieving revision 1.20
diff -u -r1.20 networkio.h
--- srclib/apr/include/arch/win32/networkio.h 2001/07/16 20:37:00 1.20
+++ srclib/apr/include/arch/win32/networkio.h 2001/11/08 14:33:34
@@ -70,6 +70,7 @@
     int local_interface_unknown;
     apr_int32_t netmask;
     apr_int32_t inherit;
+    apr_socket_iol_t *iol;
 };

 struct apr_pollfd_t {
Index: srclib/apr/network_io/unix/poll.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/poll.c,v
retrieving revision 1.49
diff -u -r1.49 poll.c
--- srclib/apr/network_io/unix/poll.c 2001/10/02 18:51:17 1.49
+++ srclib/apr/network_io/unix/poll.c 2001/11/08 14:33:34
@@ -57,7 +57,7 @@

 #ifdef HAVE_POLL    /* We can just use poll to do our socket polling. */

-apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
+apr_status_t socket_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
 {
     (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t));
     if ((*new) == NULL) {
@@ -115,7 +115,7 @@
     return rv;
 }

-apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset,
+apr_status_t socket_poll_socket_add(apr_pollfd_t *aprset,
           apr_socket_t *sock, apr_int16_t event)
 {
     int i = 0;
@@ -135,7 +135,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
+apr_status_t socket_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
       apr_interval_time_t timeout)
 {
     int rv;
@@ -153,7 +153,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t
*aprset)
+apr_status_t socket_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t
*aprset)
 {
     int i = 0;

@@ -167,7 +167,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset,
+apr_status_t socket_poll_socket_mask(apr_pollfd_t *aprset,
                                   apr_socket_t *sock, apr_int16_t events)
 {
     apr_int16_t newevents;
@@ -187,7 +187,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock)
+apr_status_t socket_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock)
 {
     int i = 0;
     while(i < aprset->curpos && aprset->pollset[i].fd != sock->socketdes)
{
@@ -204,7 +204,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events)
+apr_status_t socket_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t events)
 {
     int i = 0;
     apr_int16_t newevents;
@@ -222,7 +222,7 @@

 #else    /* Use select to mimic poll */

-apr_status_t apr_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
+apr_status_t socket_poll_setup(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
 {
     (*new) = (apr_pollfd_t *)apr_pcalloc(cont, sizeof(apr_pollfd_t) * num);
     if ((*new) == NULL) {
@@ -245,7 +245,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_socket_add(apr_pollfd_t *aprset,
+apr_status_t socket_poll_socket_add(apr_pollfd_t *aprset,
                                apr_socket_t *sock, apr_int16_t event)
 {
     if (event & APR_POLLIN) {
@@ -263,7 +263,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_socket_mask(apr_pollfd_t *aprset,
+apr_status_t socket_poll_socket_mask(apr_pollfd_t *aprset,
                                   apr_socket_t *sock,
                                   apr_int16_t events)
 {
@@ -279,7 +279,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
+apr_status_t socket_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
       apr_interval_time_t timeout)
 {
     int rv;
@@ -311,7 +311,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t
*aprset)
+apr_status_t socket_poll_revents_get(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t
*aprset)
 {
     apr_int16_t revents = 0;
     char data[1];
@@ -358,7 +358,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock)
+apr_status_t socket_poll_socket_remove(apr_pollfd_t *aprset, apr_socket_t *sock)
 {
     FD_CLR(sock->socketdes, aprset->read_set);
     FD_CLR(sock->socketdes, aprset->except_set);
@@ -366,7 +366,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event)
+apr_status_t socket_poll_socket_clear(apr_pollfd_t *aprset, apr_int16_t event)
 {
     if (event & APR_POLLIN) {
         FD_ZERO(aprset->read_set);
@@ -383,12 +383,12 @@

 #endif

-apr_status_t apr_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data)
+apr_status_t socket_poll_data_get(apr_pollfd_t *pollfd, const char *key, void *data)
 {
     return apr_pool_userdata_get(data, key, pollfd->cntxt);
 }

-apr_status_t apr_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key,
+apr_status_t socket_poll_data_set(apr_pollfd_t *pollfd, void *data, const char *key,
                             apr_status_t (*cleanup) (void *))
 {
     return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt);
@@ -399,7 +399,7 @@
  * for right now, we'll leave it this way, and change it later if
  * necessary.
  */
-apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file)
+apr_status_t socket_from_file(apr_socket_t **newsock, apr_file_t *file)
 {
     (*newsock) = apr_pcalloc(file->cntxt, sizeof(**newsock));
     (*newsock)->socketdes = file->filedes;
Index: srclib/apr/network_io/unix/sa_common.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/sa_common.c,v
retrieving revision 1.45
diff -u -r1.45 sa_common.c
--- srclib/apr/network_io/unix/sa_common.c 2001/09/12 19:46:12 1.45
+++ srclib/apr/network_io/unix/sa_common.c 2001/11/08 14:33:34
@@ -89,8 +89,8 @@
 #define GETHOSTBYNAME_BUFLEN 512
 #endif

-APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr,
-                                       apr_port_t port)
+APR_DECLARE(apr_status_t) apr_sockaddr_port_set(apr_sockaddr_t *sockaddr,
+                                                apr_port_t port)
 {
     sockaddr->port = port;
     /* XXX IPv6: assumes sin_port and sin6_port at same offset */
@@ -102,8 +102,7 @@
  * since we have apr_sockaddr_info_get(), but we need to clean up Apache's
  * listen.c a bit more first.
  */
-APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr,
-                                         const char *addr)
+APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr, const char *addr)
 {
     apr_uint32_t ipaddr;

@@ -125,16 +124,16 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port,
-                                       apr_sockaddr_t *sockaddr)
+APR_DECLARE(apr_status_t) apr_sockaddr_port_get(apr_port_t *port,
+                                                apr_sockaddr_t *sockaddr)
 {
     /* XXX IPv6 - assumes sin_port and sin6_port at same offset */
     *port = ntohs(sockaddr->sa.sin.sin_port);
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
-                                         apr_sockaddr_t *sockaddr)
+APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr,
+                                              apr_sockaddr_t *sockaddr)
 {
     *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len);
     apr_inet_ntop(sockaddr->sa.sin.sin_family,
@@ -177,9 +176,8 @@
 #endif
 }

-APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa,
-                                           apr_interface_e which,
-                                           apr_socket_t *sock)
+apr_status_t socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which,
+                             apr_socket_t *sock)
 {
     if (which == APR_LOCAL) {
         if (sock->local_interface_unknown || sock->local_port_unknown) {
@@ -327,9 +325,9 @@
 #endif

 APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,
-                                          const char *hostname,
-                                          apr_int32_t family, apr_port_t port,
-                                          apr_int32_t flags, apr_pool_t *p)
+                                                const char *hostname,
+                                                apr_int32_t family, apr_port_t port,
+                                                apr_int32_t flags, apr_pool_t *p)
 {
     (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t));
     if ((*sa) == NULL)
@@ -582,8 +580,8 @@
 #endif
 }

-APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
-                                            const char *servname)
+APR_DECLARE(apr_status_t) socket_getservbyname(apr_sockaddr_t *sockaddr,
+                                               const char *servname)
 {
     struct servent *se;

Index: srclib/apr/network_io/unix/sendrecv.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/sendrecv.c,v
retrieving revision 1.76
diff -u -r1.76 sendrecv.c
--- srclib/apr/network_io/unix/sendrecv.c 2001/08/22 19:23:24 1.76
+++ srclib/apr/network_io/unix/sendrecv.c 2001/11/08 14:33:34
@@ -52,6 +52,7 @@
  * <http://www.apache.org/>.
  */

+#incluide "apr_network_io.h"
 #include "networkio.h"

 #if APR_HAS_SENDFILE
@@ -93,7 +94,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
+apr_status_t socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
 {
     ssize_t rv;

@@ -122,7 +123,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
+apr_status_t socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
 {
     ssize_t rv;
     apr_status_t arv;
@@ -164,7 +165,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where,
+apr_status_t socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where,
                         apr_int32_t flags, const char *buf, apr_size_t *len)
 {
     ssize_t rv;
@@ -197,7 +198,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
+apr_status_t socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
                           apr_int32_t flags, char *buf,
                           apr_size_t *len)
 {
@@ -234,8 +235,8 @@
 }

 #ifdef HAVE_WRITEV
-apr_status_t apr_sendv(apr_socket_t * sock, const struct iovec *vec,
-                     apr_int32_t nvec, apr_size_t *len)
+apr_status_t socket_sendv(apr_socket_t * sock, const struct iovec *vec,
+                          apr_int32_t nvec, apr_size_t *len)
 {
     apr_ssize_t rv;

@@ -277,7 +278,7 @@

 #if defined(__linux__) && defined(HAVE_WRITEV)

-apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
+apr_status_t socket_sendfile(apr_socket_t *sock, apr_file_t *file,
           apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len,
           apr_int32_t flags)
 {
@@ -389,7 +390,7 @@
 #elif defined(__FreeBSD__)

 /* Release 3.1 or greater */
-apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file,
+apr_status_t socket_sendfile(apr_socket_t * sock, apr_file_t * file,
           apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len,
           apr_int32_t flags)
 {
@@ -493,7 +494,7 @@
  * if nbytes == 0, the rest of the file (from offset) is sent
  */

-apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
+apr_status_t socket_sendfile(apr_socket_t *sock, apr_file_t *file,
      apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len,
      apr_int32_t flags)
 {
@@ -624,7 +625,7 @@
  * AIX -  version 4.3.2 with APAR IX85388, or version 4.3.3 and above
  * OS/390 - V2R7 and above
  */
-apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file,
+apr_status_t socket_sendfile(apr_socket_t * sock, apr_file_t * file,
                         apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len,
                         apr_int32_t flags)
 {
@@ -758,7 +759,7 @@
  * 111298-01, 108529-09, 109473-06, 109235-04, 108996-02, 111296-01, 109026-04,
  * 108992-13
  */
-apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
+apr_status_t socket_sendfile(apr_socket_t *sock, apr_file_t *file,
           apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len,
           apr_int32_t flags)
 {
@@ -870,11 +871,11 @@
  * apr_sendfile() doesn't work on the platform;
  * this dummy version is just to get exports.c to compile/link
  */
-apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
+apr_status_t socket_sendfile(apr_socket_t *sock, apr_file_t *file,
                           apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len,
                           apr_int32_t flags); /* avoid warning for no proto */

-apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
+apr_status_t socket_sendfile(apr_socket_t *sock, apr_file_t *file,
                           apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len,
                           apr_int32_t flags)
 {
Index: srclib/apr/network_io/unix/sockets.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/sockets.c,v
retrieving revision 1.87
diff -u -r1.87 sockets.c
--- srclib/apr/network_io/unix/sockets.c 2001/08/08 05:48:58 1.87
+++ srclib/apr/network_io/unix/sockets.c 2001/11/08 14:33:35
@@ -126,7 +126,7 @@
     (*new)->remote_addr->pool = p;
 }

-apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
+apr_status_t socket_create(apr_socket_t **new, int ofamily, int type,
                                apr_pool_t *cont)
 {
     int family = ofamily;
@@ -166,18 +166,18 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
+apr_status_t socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
 {
     return (shutdown(thesocket->socketdes, how) == -1) ? errno : APR_SUCCESS;
 }

-apr_status_t apr_socket_close(apr_socket_t *thesocket)
+apr_status_t socket_close(apr_socket_t *thesocket)
 {
     apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup);
     return socket_cleanup(thesocket);
 }

-apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
+apr_status_t socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
 {
     if (bind(sock->socketdes,
              (struct sockaddr *)&sa->sa, sa->salen) == -1) {
@@ -193,7 +193,7 @@
     }
 }

-apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog)
+apr_status_t socket_listen(apr_socket_t *sock, apr_int32_t backlog)
 {
     if (listen(sock->socketdes, backlog) == -1)
         return errno;
@@ -201,7 +201,7 @@
         return APR_SUCCESS;
 }

-apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t
*connection_context)
+apr_status_t socket_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t
*connection_context)
 {
     alloc_socket(new, connection_context);
     set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM);
@@ -259,7 +259,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
+apr_status_t socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
 {
     int rc;

@@ -315,12 +315,12 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_socket_data_get(void **data, const char *key, apr_socket_t *sock)
+apr_status_t socket_data_get(void **data, const char *key, apr_socket_t *sock)
 {
     return apr_pool_userdata_get(data, key, sock->cntxt);
 }

-apr_status_t apr_socket_data_set(apr_socket_t *sock, void *data, const char *key,
+apr_status_t socket_data_set(apr_socket_t *sock, void *data, const char *key,
                               apr_status_t (*cleanup) (void *))
 {
     return apr_pool_userdata_set(data, key, cleanup, sock->cntxt);
Index: srclib/apr/network_io/unix/sockopt.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/sockopt.c,v
retrieving revision 1.48
diff -u -r1.48 sockopt.c
--- srclib/apr/network_io/unix/sockopt.c 2001/07/30 17:56:16 1.48
+++ srclib/apr/network_io/unix/sockopt.c 2001/11/08 14:33:35
@@ -110,7 +110,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
+apr_status_t socket_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
 {
     int one;
     apr_status_t stat;
@@ -279,7 +279,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on)
+apr_status_t socket_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on)
 {
     switch(opt) {
         case APR_SO_TIMEOUT:
@@ -291,7 +291,7 @@
     return APR_SUCCESS;
 }

-apr_status_t apr_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont)
+apr_status_t socket_gethostname(char *buf, apr_int32_t len, apr_pool_t *cont)
 {
     if (gethostname(buf, len) == -1)
         return errno;
@@ -300,7 +300,7 @@
 }

 #if APR_HAS_SO_ACCEPTFILTER
-apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name,
+apr_status_t socket_accept_filter(apr_socket_t *sock, char *name,
                                       char *args)
 {
     struct accept_filter_arg af;
Index: srclib/apr/network_io/win32/poll.c
===================================================================
RCS file: /home/cvs/apr/network_io/win32/poll.c,v
retrieving revision 1.28
diff -u -r1.28 poll.c
--- srclib/apr/network_io/win32/poll.c 2001/08/06 16:15:04 1.28
+++ srclib/apr/network_io/win32/poll.c 2001/11/08 14:33:35
@@ -60,7 +60,7 @@
 #include <time.h>


-APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num,
+APR_DECLARE(apr_status_t) apr_poll_setup(apr_pollfd_t **new, apr_int32_t num,
                                          apr_pool_t *cont)
 {
     (*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num);
@@ -80,9 +80,8 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_poll_socket_add(apr_pollfd_t *aprset,
-                                              apr_socket_t *sock,
-                                              apr_int16_t event)
+apr_status_t socket_poll_socket_add(apr_pollfd_t *aprset, apr_socket_t *sock,
+                                    apr_int16_t event)
 {
     if (event & APR_POLLIN) {
         FD_SET(sock->sock, aprset->read);
@@ -146,9 +145,9 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_poll_revents_get(apr_int16_t *event,
-                                          apr_socket_t *sock,
-                                          apr_pollfd_t *aprset)
+apr_status_t socket_poll_revents_get(apr_int16_t *event,
+                                     apr_socket_t *sock,
+                                     apr_pollfd_t *aprset)
 {
     apr_int16_t revents = 0;
     WSABUF data;
@@ -204,21 +203,21 @@
 }

 APR_DECLARE(apr_status_t) apr_poll_data_get(apr_pollfd_t *pollfd,
-                                           const char *key, void *data)
+                                            const char *key, void *data)
 {
     return apr_pool_userdata_get(data, key, pollfd->cntxt);
 }

 APR_DECLARE(apr_status_t) apr_poll_data_set(apr_pollfd_t *pollfd, void *data,
-                                           const char *key,
-                                           apr_status_t (*cleanup)(void *))
+                                            const char *key,
+                                            apr_status_t (*cleanup)(void *))
 {
     return apr_pool_userdata_set(data, key, cleanup, pollfd->cntxt);
 }

-APR_DECLARE(apr_status_t) apr_poll_socket_mask(apr_pollfd_t *aprset,
-                                               apr_socket_t *sock,
-                                               apr_int16_t events)
+apr_status_t socket_poll_socket_mask(apr_pollfd_t *aprset,
+                                     apr_socket_t *sock,
+                                     apr_int16_t events)
 {
     if (events & APR_POLLIN) {
         FD_CLR(sock->sock, aprset->read);
@@ -235,14 +234,14 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_poll_socket_remove(apr_pollfd_t *aprset,
-                                                 apr_socket_t *sock)
+apr_status_t socket_poll_socket_remove(apr_pollfd_t *aprset,
+                                       apr_socket_t *sock)
 {
-    return apr_poll_socket_mask(aprset, sock, ~0);
+    return socket_poll_socket_mask(aprset, sock, ~0);
 }

 APR_DECLARE(apr_status_t) apr_poll_socket_clear(apr_pollfd_t *aprset,
-                                                 apr_int16_t events)
+                                                apr_int16_t events)
 {
     if (events & APR_POLLIN) {
         FD_ZERO(aprset->read);
Index: srclib/apr/network_io/win32/sendrecv.c
===================================================================
RCS file: /home/cvs/apr/network_io/win32/sendrecv.c,v
retrieving revision 1.43
diff -u -r1.43 sendrecv.c
--- srclib/apr/network_io/win32/sendrecv.c 2001/08/19 02:05:04 1.43
+++ srclib/apr/network_io/win32/sendrecv.c 2001/11/08 14:33:35
@@ -71,8 +71,7 @@
 #define MAX_SEGMENT_SIZE 65536
 #define WSABUF_ON_STACK 50

-APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf,
-                                   apr_size_t *len)
+apr_status_t socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
 {
     apr_ssize_t rv;
     WSABUF wsaData;
@@ -93,9 +92,7 @@
     return APR_SUCCESS;
 }

-
-APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf,
-                                   apr_size_t *len)
+apr_status_t socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
 {
     apr_ssize_t rv;
     WSABUF wsaData;
@@ -117,11 +114,10 @@
     return APR_SUCCESS;

 }
-

-APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock,
-                                    const struct iovec *vec,
-                                    apr_int32_t nvec, apr_size_t *nbytes)
+apr_status_t socket_sendv(apr_socket_t *sock,
+                          const struct iovec *vec,
+                          apr_int32_t nvec, apr_size_t *nbytes)
 {
     apr_status_t rc = APR_SUCCESS;
     apr_ssize_t rv;
@@ -153,9 +149,9 @@
 }


-APR_DECLARE(apr_status_t) apr_sendto(apr_socket_t *sock, apr_sockaddr_t *where,
-                                     apr_int32_t flags, const char *buf,
-                                     apr_size_t *len)
+apr_status_t socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where,
+                           apr_int32_t flags, const char *buf,
+                           apr_size_t *len)
 {
     apr_ssize_t rv;

@@ -171,11 +167,10 @@
     return APR_SUCCESS;
 }

-
-APR_DECLARE(apr_status_t) apr_recvfrom(apr_sockaddr_t *from,
-                                       apr_socket_t *sock,
-                                       apr_int32_t flags,
-                                       char *buf, apr_size_t *len)
+apr_status_t socket_recvfrom(apr_sockaddr_t *from,
+                             apr_socket_t *sock,
+                             apr_int32_t flags,
+                             char *buf, apr_size_t *len)
 {
     apr_ssize_t rv;

@@ -192,7 +187,6 @@
     return APR_SUCCESS;
 }

-
 static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec,
apr_pool_t *p)
 {
     int ptr = 0;
@@ -240,9 +234,9 @@
  * arg 5) Number of bytes to send out of the file
  * arg 6) APR flags that are mapped to OS specific flags
  */
-APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
-                                       apr_hdtr_t *hdtr, apr_off_t *offset,
-                                       apr_size_t *len, apr_int32_t flags)
+apr_status_t socket_sendfile(apr_socket_t *sock, apr_file_t *file,
+                             apr_hdtr_t *hdtr, apr_off_t *offset,
+                             apr_size_t *len, apr_int32_t flags)
 {
     apr_status_t status = APR_SUCCESS;
     apr_ssize_t rv;
@@ -266,13 +260,13 @@
     /* Handle the goofy case of sending headers/trailers and a zero byte file */
     if (!bytes_to_send && hdtr) {
         if (hdtr->numheaders) {
-            rv = apr_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes);
+            rv = socket_sendv(sock, hdtr->headers, hdtr->numheaders, &nbytes);
file://WGS
             if (rv != APR_SUCCESS)
                 return rv;
             *len += nbytes;
         }
         if (hdtr->numtrailers) {
-            rv = apr_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes);
+            rv = socket_sendv(sock, hdtr->trailers, hdtr->numtrailers, &nbytes);
             if (rv != APR_SUCCESS)
                 return rv;
             *len += nbytes;
Index: srclib/apr/network_io/win32/sockets.c
===================================================================
RCS file: /home/cvs/apr/network_io/win32/sockets.c,v
retrieving revision 1.65
diff -u -r1.65 sockets.c
--- srclib/apr/network_io/win32/sockets.c 2001/08/09 23:28:38 1.65
+++ srclib/apr/network_io/win32/sockets.c 2001/11/08 14:33:35
@@ -117,8 +117,8 @@
     (*new)->remote_addr->pool = p;
 }

-APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new, int ofamily,
-                                            int type, apr_pool_t *cont)
+apr_status_t socket_create(apr_socket_t **new, int ofamily,
+                           int type, apr_pool_t *cont)
 {
     int family = ofamily;

@@ -168,8 +168,7 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket,
-                                       apr_shutdown_how_e how)
+apr_status_t socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
 {
     int winhow;

@@ -197,13 +196,13 @@
     }
 }

-APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket)
+apr_status_t socket_close(apr_socket_t *thesocket)
 {
     apr_pool_cleanup_kill(thesocket->cntxt, thesocket, socket_cleanup);
     return socket_cleanup(thesocket);
 }

-APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
+apr_status_t socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
 {
     if (bind(sock->sock,
              (struct sockaddr *)&sa->sa,
@@ -219,7 +218,7 @@
     }
 }

-APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog)
+apr_status_t  socket_listen(apr_socket_t *sock, apr_int32_t backlog)
 {
     if (listen(sock->sock, backlog) == SOCKET_ERROR)
         return apr_get_netos_error();
@@ -227,8 +226,7 @@
         return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock,
-                                     apr_pool_t *p)
+apr_status_t socket_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *p)
 {
     alloc_socket(new, p);
     set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM);
@@ -276,7 +274,7 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
+apr_status_t socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
 {
     apr_status_t rv;

@@ -347,15 +345,13 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key,
+apr_status_t socket_data_get(void **data, const char *key,
                                              apr_socket_t *socket)
 {
     return apr_pool_userdata_get(data, key, socket->cntxt);
 }

-APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *socket, void *data,
-                                             const char *key,
-                                             apr_status_t (*cleanup)(void *))
+apr_status_t socket_data_set(apr_socket_t *socket, void *data, const char *key,
apr_status_t (*cleanup)(void *))
 {
     return apr_pool_userdata_set(data, key, cleanup, socket->cntxt);
 }
@@ -421,4 +417,4 @@

 APR_DECLARE_UNSET_INHERIT(socket) {
     return;
-}
\ No newline at end of file
+}
Index: srclib/apr/network_io/win32/sockopt.c
===================================================================
RCS file: /home/cvs/apr/network_io/win32/sockopt.c,v
retrieving revision 1.35
diff -u -r1.35 sockopt.c
--- srclib/apr/network_io/win32/sockopt.c 2001/08/09 23:26:18 1.35
+++ srclib/apr/network_io/win32/sockopt.c 2001/11/08 14:33:35
@@ -78,8 +78,8 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock,
-                                           apr_int32_t opt, apr_int32_t on)
+apr_status_t socket_setsocketopt(apr_socket_t *sock,
+                                 apr_int32_t opt, apr_int32_t on)
 {
     int one;
     apr_status_t stat;
@@ -170,8 +170,8 @@
     return APR_SUCCESS;
 }

-APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock,
-                                           apr_int32_t opt, apr_int32_t *on)
+apr_status_t socket_getsocketopt(apr_socket_t *sock,
+                                 apr_int32_t opt, apr_int32_t *on)
 {
 #ifdef NETWARE
     int sol_opt = 0;
@@ -231,13 +231,11 @@
 }


-APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len,
-                                          apr_pool_t *cont)
+apr_status_t socket_gethostname(char *buf, int len,
+                                apr_pool_t *cont)
 {
     if (gethostname(buf, len) == -1)
         return apr_get_netos_error();
     else
         return APR_SUCCESS;
 }
-
-
Index: support/ab.c
===================================================================
RCS file: /home/cvs/httpd-2.0/support/ab.c,v
retrieving revision 1.83
diff -u -r1.83 ab.c
--- support/ab.c 2001/10/17 13:42:22 1.83
+++ support/ab.c 2001/11/08 14:33:36
@@ -850,7 +850,7 @@
     apr_pool_create(&c->ctx, cntxt);

     if ((rv = apr_socket_create(&c->aprsock, destsa->sa.sin.sin_family,
-    SOCK_STREAM, c->ctx)) != APR_SUCCESS) {
+    SOCK_STREAM, NULL, c->ctx)) != APR_SUCCESS) {
  apr_err("socket", rv);
     }
     c->start = apr_time_now();


Mime
View raw message