httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Removing IOLs
Date Sat, 19 Aug 2000 18:36:53 GMT

So, I am going to scare some people, and piss off others.  That's my job
sometimes.  :-)  I am posting a patch that removes IOLs from
Apache.  With filtering, IOLs aren't really necessary anymore.  I have
removed all references to IOLs in Apache 2.0, except for two comments in
the Windows MPM, which I would like either Bill to look at.

I will openly admit here that this includes the same hack a couple of
times (always documented), that instead of passing a pipe from a CGI using
a bucket, we just turn the apr_pipe into an apr_socket to include it in
the BUFF structure.  Once we get the pipe bucket written, this can be
removed completely.

Here is the patch, anybody mind if I commit Monday sometime?

Ryan

Index: STATUS
===================================================================
RCS file: /home/cvs/apache-2.0/STATUS,v
retrieving revision 1.130
diff -u -d -b -w -u -r1.130 STATUS
--- STATUS	2000/08/17 17:49:04	1.130
+++ STATUS	2000/08/19 18:26:02
@@ -24,9 +24,8 @@
       filters to flush any pending content. See http_protocol.c:
       ap_finalize_sub_req_protocol() and ap_rflush()
 
-    * Remove Buff and IOL from the code.  To do this, a chunking and 
+    * Remove Buff from the code.  To do this, a chunking and 
       translation filter must be written.  This allows us to remove BUFF.
-      IOLs can be removed as soon as somebody gets to it.
 
     * apachectl not being built or installed
 
Index: src/CHANGES
===================================================================
RCS file: /home/cvs/apache-2.0/src/CHANGES,v
retrieving revision 1.207
diff -u -d -b -w -u -r1.207 CHANGES
--- src/CHANGES	2000/08/19 06:04:51	1.207
+++ src/CHANGES	2000/08/19 18:26:03
@@ -1,5 +1,8 @@
 Changes with Apache 2.0a7
 
+  *) Remove IOLs from Apache.  With filtering, IOLs are no longer necessary
+     [Ryan Bloom]
+
   *) Add generic support for reference-counting the resources used by
      buckets, and alter the HEAP and MMAP buckets to use it. Change
      the way buckets are initialised to support changing the type of
Index: src/include/ap_mpm.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/ap_mpm.h,v
retrieving revision 1.15
diff -u -d -b -w -u -r1.15 ap_mpm.h
--- src/include/ap_mpm.h	2000/08/02 05:25:27	1.15
+++ src/include/ap_mpm.h	2000/08/19 18:26:04
@@ -98,7 +98,7 @@
     unix/posix notes:
     - The MPM does not set a SIGALRM handler, user code may use SIGALRM.
 	But the preferred method of handling timeouts is to use the
-	timeouts provided by the BUFF/iol abstraction.
+	timeouts provided by the BUFF abstraction.
     - The proper setting for SIGPIPE is SIG_IGN, if user code changes it
         for any of their own processing, it must be restored to SIG_IGN
 	prior to executing or returning to any apache code.
Index: src/include/buff.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/buff.h,v
retrieving revision 1.34
diff -u -d -b -w -u -r1.34 buff.h
--- src/include/buff.h	2000/08/07 19:25:59	1.34
+++ src/include/buff.h	2000/08/19 18:26:04
@@ -66,7 +66,6 @@
 #ifdef APR_HAVE_STDARG_H
 #include <stdarg.h>
 #endif
-#include "ap_iol.h"
 #include "apr_lib.h"
 #include "apr_general.h"
 #ifdef APACHE_XLATE
@@ -168,7 +167,7 @@
 
     apr_pool_t *pool;
 
-    ap_iol *iol;
+    apr_socket_t *bsock;
 #ifdef APACHE_XLATE
     b_read_ops b_read_ops;      /* some read operations are replaced when 
                                  * translation is on */
@@ -199,7 +198,7 @@
 #define BO_BYTECT (1)
 /* XXX: timeouts should probably be redefined to be in microseconds to match APR */
 /* timeout values have the same semantics as those documented for timeouts
-   in ap_iol.h... that is:
+   in apr_socket.h... that is:
    timeout < 0 is blocking infinite/no-timeout
    timeout == 0 is non-blocking
    timeout > 0 is blocking with timeout after the indicated number of seconds
@@ -222,8 +221,8 @@
 /* Stream creation and modification */
 API_EXPORT(BUFF *) ap_bcreate(apr_pool_t *p, int flags);
 
-API_EXPORT(void) ap_bpush_iol(BUFF *fb, ap_iol *iol);
-API_EXPORT(void) ap_bpop_iol(ap_iol **iol, BUFF *fb);
+API_EXPORT(void) ap_bpush_socket(BUFF *fb, apr_socket_t *sock);
+API_EXPORT(void) ap_bpop_socket(apr_socket_t **sock, BUFF *fb);
 
 /* XXX - unused right now - mvsk */
 API_EXPORT(BUFF *) ap_bopenf(apr_pool_t *a, const char *name, int flg, int mode);
Index: src/main/Makefile.in
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/Makefile.in,v
retrieving revision 1.17
diff -u -d -b -w -u -r1.17 Makefile.in
--- src/main/Makefile.in	2000/07/28 20:31:00	1.17
+++ src/main/Makefile.in	2000/08/19 18:26:13
@@ -7,7 +7,7 @@
 	buff.c http_config.c http_core.c http_log.c http_main.c \
 	http_protocol.c http_request.c http_vhost.c util.c util_date.c \
 	util_script.c util_uri.c util_md5.c util_cfgtree.c util_ebcdic.c \
-	rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \
+	rfc1413.c http_connection.c listen.c \
         mpm_common.c util_charset.c util_debug.c util_xml.c \
 	util_filter.c
 
Index: src/main/buff.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/buff.c,v
retrieving revision 1.58
diff -u -d -b -w -u -r1.58 buff.c
--- src/main/buff.c	2000/08/17 00:54:03	1.58
+++ src/main/buff.c	2000/08/19 18:26:13
@@ -209,20 +209,20 @@
         fb->xbuf = NULL;
     }
 #endif
-    return iol_close(fb->iol);
+    return apr_close_socket(fb->bsock);
 }
 
 /*
  * Push some I/O file descriptors onto the stream
  */
-API_EXPORT(void) ap_bpush_iol(BUFF *fb, ap_iol *iol)
+API_EXPORT(void) ap_bpush_socket(BUFF *fb, apr_socket_t *sock)
 {
-    fb->iol = iol;
+    fb->bsock = sock;
     apr_register_cleanup(fb->pool, fb, bcleanup, bcleanup);
 }
-API_EXPORT(void) ap_bpop_iol(ap_iol **iol, BUFF *fb)
+API_EXPORT(void) ap_bpop_socket(apr_socket_t **sock, BUFF *fb)
 {
-    *iol = fb->iol;
+    *sock = fb->bsock;
     apr_kill_cleanup(fb->pool, fb, bcleanup);
 }
 
@@ -239,8 +239,8 @@
 	    fb->flags |= B_NONBLOCK;
 	    /* XXX: should remove B_WR now... */
 	}
-        /* ### set berrno if iol_setopt returns an error? */
-	return iol_setopt(fb->iol, AP_IOL_TIMEOUT, optval);
+        /* ### set berrno if apr_setsocketopt returns an error? */
+	return apr_setsocketopt(fb->bsock, APR_SO_TIMEOUT, *(int *)optval);
 
 #ifdef APACHE_XLATE
     case BO_WXLATE:
@@ -282,8 +282,8 @@
 	return APR_SUCCESS;
 
     case BO_TIMEOUT:
-        /* ### set berrno if iol_getopt returns an error? */
-	return iol_getopt(fb->iol, AP_IOL_TIMEOUT, optval);
+        /* ### set berrno if apr_getsocketopt returns an error? */
+	return apr_getsocketopt(fb->bsock, APR_SO_TIMEOUT, optval);
         
 #ifdef APACHE_XLATE
     case BO_WXLATE:
@@ -358,12 +358,13 @@
     int timeout = 0;
 
     /* test for a block */
-    iol_getopt(fb->iol, AP_IOL_TIMEOUT, &timeout);
-    iol_setopt(fb->iol, AP_IOL_TIMEOUT, &zero);
+    apr_getsocketopt(fb->bsock, APR_SO_TIMEOUT, &timeout);
+    apr_setsocketopt(fb->bsock, APR_SO_TIMEOUT, zero);
     do {
-        rv = iol_read(fb->iol, buf, nbyte, bytes_read);
+        *bytes_read = nbyte;
+        rv = apr_recv(fb->bsock, buf, bytes_read);
     } while (rv == APR_EINTR && !(fb->flags & B_EOUT));
-    iol_setopt(fb->iol, AP_IOL_TIMEOUT, &timeout);
+    apr_setsocketopt(fb->bsock, APR_SO_TIMEOUT, timeout);
 
     /* treat any error as if it would block as well */ 
     if (rv != APR_SUCCESS) {
@@ -396,7 +397,7 @@
     }
 }
 
-/* a wrapper around iol_read which checks for errors and EOFs */
+/* a wrapper around apr_recv which checks for errors and EOFs */
 static apr_status_t read_with_errors(BUFF *fb, void *buf, apr_size_t nbyte,
                                     apr_ssize_t *bytes_read)
 {
@@ -407,7 +408,8 @@
     }
     if (rv != APR_SUCCESS) {
         do {
-            rv = iol_read(fb->iol, buf, nbyte, bytes_read);
+            *bytes_read = nbyte;
+            rv = apr_recv(fb->bsock, buf, bytes_read);
         } while (rv == EINTR && !(fb->flags &B_EOUT));
     }
     if (rv == APR_SUCCESS && *bytes_read == 0) {
@@ -686,7 +688,7 @@
                                       int nvec, apr_ssize_t *bytes_written)
 {
     apr_status_t rv;
-    rv = iol_writev(fb->iol, vec, nvec, bytes_written);
+    rv = apr_sendv(fb->bsock, vec, nvec, bytes_written);
     fb->bytes_sent += *bytes_written;
     if (rv != APR_SUCCESS) {
         /* ### set berrno? */
@@ -819,7 +821,8 @@
 {
     apr_status_t rv;
 
-    rv = iol_write(fb->iol, buf, nbyte, bytes_written);
+    *bytes_written = nbyte;
+    rv = apr_send(fb->bsock, buf, bytes_written);
     fb->bytes_sent += *bytes_written;
     if (rv != APR_SUCCESS) {
         /* ### set berrno? */
@@ -1072,7 +1075,7 @@
         ap_bsetflag(fb, B_EOUT, 1);
     }
     
-    status = iol_shutdown(fb->iol, how);
+    status = apr_shutdown(fb->bsock, how);
     
     return status;
 }
@@ -1092,7 +1095,7 @@
     else
 	rc1 = APR_SUCCESS;
     apr_kill_cleanup(fb->pool, fb, bcleanup);
-    rc2 = iol_close(fb->iol);
+    rc2 = apr_close_socket(fb->bsock);
 
 #ifdef APACHE_XLATE
     if (fb->xbuf) {
@@ -1262,22 +1265,3 @@
     return res;
 }
 
-API_EXPORT(BUFF *) ap_bopenf(apr_pool_t *a, const char *name, int flg, int mode)
-{
-    ap_iol *iol;
-    BUFF *fb;
-    apr_status_t rv;
-    apr_file_t *file = NULL;
-    rv = apr_open(&file, name, flg, 0, a);
-    if ((rv != APR_SUCCESS) || (file == NULL)) {
-        return NULL;
-    }
-    iol = ap_create_file_iol(file);
-    if (!iol) {
-        return NULL;
-    }
-    fb = ap_bcreate(a, ((flg &(B_RD|B_RDWR)) ? B_RD : 0)
-		     | ((flg & (B_WR|B_RDWR)) ? B_WR : 0));
-    ap_bpush_iol(fb, iol);
-    return fb;
-}
Index: src/main/http_core.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v
retrieving revision 1.105
diff -u -d -b -w -u -r1.105 http_core.c
--- src/main/http_core.c	2000/08/19 06:04:57	1.105
+++ src/main/http_core.c	2000/08/19 18:26:13
@@ -2966,7 +2966,7 @@
 /* Default filter.  This filter should almost always be used.  It's only job
  * is to send the headers if they haven't already been sent, and then send
  * the actual data.  To send the data, we create an iovec out of the bucket
- * brigade and then call the iol's writev function.  On platforms that don't
+ * brigade and then call the sendv function.  On platforms that don't
  * have writev, we have the problem of creating a lot of potentially small
  * packets that we are sending to the network.
  *
Index: src/main/http_protocol.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
retrieving revision 1.113
diff -u -d -b -w -u -r1.113 http_protocol.c
--- src/main/http_protocol.c	2000/08/19 06:04:57	1.113
+++ src/main/http_protocol.c	2000/08/19 18:26:13
@@ -2312,7 +2312,7 @@
 
     /*
      * We want to send any data held in the client buffer on the
-     * call to iol_sendfile. So hijack it then set outcnt to 0
+     * call to apr_sendfile. So hijack it then set outcnt to 0
      * to prevent the data from being sent to the client again
      * when the buffer is flushed to the client at the end of the
      * request.
@@ -2333,7 +2333,7 @@
         flags |= APR_SENDFILE_DISCONNECT_SOCKET;
     }
 
-    rv = iol_sendfile(r->connection->client->iol, 
+    rv = apr_sendfile(r->connection->client->bsock, 
                       fd,      /* The file to send */
                       &hdtr,   /* Header and trailer iovecs */
                       &offset, /* Offset in file to begin sending from */
Index: src/modules/mpm/beos/beos.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/beos/beos.c,v
retrieving revision 1.21
diff -u -d -b -w -u -r1.21 beos.c
--- src/modules/mpm/beos/beos.c	2000/08/13 18:38:03	1.21
+++ src/modules/mpm/beos/beos.c	2000/08/19 18:26:14
@@ -76,7 +76,6 @@
 #include "http_connection.h"
 #include "ap_mpm.h"
 #include "beosd.h"
-#include "ap_iol.h"
 #include "ap_listen.h"
 #include "scoreboard.h" 
 #include <kernel/OS.h>
@@ -308,7 +307,6 @@
 {
     BUFF *conn_io;
     conn_rec *current_conn;
-    ap_iol *iol;
     long conn_id = my_child_num;
     int csd;
 
@@ -323,16 +321,8 @@
 	    return;
     }
     
-    iol = ap_iol_attach_socket(p, sock);
-    if (iol == NULL) {
-        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL,
-          "error attaching to socket");
-        apr_close_socket(sock);
-	    return;
-    }
-
     conn_io = ap_bcreate(p, B_RDWR);
-    ap_bpush_iol(conn_io, iol);
+    ap_bpush_socket(conn_io, sock);
 
     current_conn = ap_new_apr_connection(p, ap_server_conf, conn_io, sock, 
                                          conn_id);
Index: src/modules/mpm/dexter/dexter.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
retrieving revision 1.123
diff -u -d -b -w -u -r1.123 dexter.c
--- src/modules/mpm/dexter/dexter.c	2000/08/06 06:07:39	1.123
+++ src/modules/mpm/dexter/dexter.c	2000/08/19 18:26:15
@@ -71,7 +71,6 @@
 #include "ap_mpm.h"
 #include "unixd.h"
 #include "mpm_common.h"
-#include "ap_iol.h"
 #include "ap_listen.h"
 #include "mpm_default.h"
 #include "mpm.h"
@@ -398,7 +397,6 @@
 {
     BUFF *conn_io;
     conn_rec *current_conn;
-    ap_iol *iol;
     int csd;
     apr_status_t rv;
 
@@ -417,9 +415,8 @@
     }
 
     ap_sock_disable_nagle(csd);
-    iol = ap_iol_attach_socket(p, sock);
     conn_io = ap_bcreate(p, B_RDWR);
-    ap_bpush_iol(conn_io, iol);
+    ap_bpush_socket(conn_io, sock);
 
     current_conn = ap_new_apr_connection(p, ap_server_conf, conn_io, sock,
                                          conn_id);
Index: src/modules/mpm/mpmt_beos/mpmt_beos.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v
retrieving revision 1.49
diff -u -d -b -w -u -r1.49 mpmt_beos.c
--- src/modules/mpm/mpmt_beos/mpmt_beos.c	2000/08/13 18:47:10	1.49
+++ src/modules/mpm/mpmt_beos/mpmt_beos.c	2000/08/19 18:26:15
@@ -72,7 +72,6 @@
 #include "http_connection.h"
 #include "ap_mpm.h"
 #include "beosd.h"
-#include "ap_iol.h"
 #include "ap_listen.h"
 #include "scoreboard.h" 
 #include "poll.h"
@@ -298,28 +297,11 @@
 {
     BUFF *conn_io;
     conn_rec *current_conn;
-    ap_iol *iol;
     long conn_id = my_child_num * HARD_THREAD_LIMIT + my_thread_num;
     int csd;
 
-    iol = ap_iol_attach_socket(p, sock);
-    if (iol == NULL) {
-        if (errno == EBADF) {
-            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, NULL,
-                "filedescriptor (%u) larger than FD_SETSIZE (%u) "
-                "found, you probably need to rebuild Apache with a "
-                "larger FD_SETSIZE", csd, FD_SETSIZE);
-        }
-        else {
-            ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL,
-                "error attaching to socket");
-        }
-        apr_close_socket(sock);
-	return;
-    }
-
     conn_io = ap_bcreate(p, B_RDWR);
-    ap_bpush_iol(conn_io, iol);
+    ap_bpush_socket(conn_io, sock);
 
     current_conn = ap_new_apr_connection(p, ap_server_conf, conn_io, sock, 
                                          conn_id);
Index: src/modules/mpm/mpmt_pthread/mpmt_pthread.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
retrieving revision 1.118
diff -u -d -b -w -u -r1.118 mpmt_pthread.c
--- src/modules/mpm/mpmt_pthread/mpmt_pthread.c	2000/08/06 06:07:40	1.118
+++ src/modules/mpm/mpmt_pthread/mpmt_pthread.c	2000/08/19 18:26:15
@@ -72,7 +72,6 @@
 #include "ap_mpm.h"
 #include "unixd.h"
 #include "mpm_common.h"
-#include "ap_iol.h"
 #include "ap_listen.h"
 #include "scoreboard.h" 
 
@@ -395,7 +394,6 @@
 {
     BUFF *conn_io;
     conn_rec *current_conn;
-    ap_iol *iol;
     long conn_id = my_child_num * HARD_THREAD_LIMIT + my_thread_num;
     int csd;
 
@@ -413,12 +411,10 @@
 
     ap_sock_disable_nagle(csd);
 
-    iol = ap_iol_attach_socket(p, sock);
-
     (void) ap_update_child_status(my_child_num, my_thread_num,  
 				  SERVER_BUSY_READ, (request_rec *) NULL);
     conn_io = ap_bcreate(p, B_RDWR);
-    ap_bpush_iol(conn_io, iol);
+    ap_bpush_socket(conn_io, sock);
 
     current_conn = ap_new_apr_connection(p, ap_server_conf, conn_io, sock,
                                          conn_id);
Index: src/modules/mpm/perchild/perchild.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/perchild/perchild.c,v
retrieving revision 1.18
diff -u -d -b -w -u -r1.18 perchild.c
--- src/modules/mpm/perchild/perchild.c	2000/08/06 21:17:33	1.18
+++ src/modules/mpm/perchild/perchild.c	2000/08/19 18:26:16
@@ -73,7 +73,6 @@
 #include "ap_mpm.h"
 #include "unixd.h"
 #include "mpm_common.h"
-#include "ap_iol.h"
 #include "ap_listen.h"
 #include "mpm_default.h"
 #include "mpm.h"
@@ -433,7 +432,6 @@
 {
     BUFF *conn_io;
     conn_rec *current_conn;
-    ap_iol *iol;
     int csd;
     apr_status_t rv;
     int thread_num = conn_id % HARD_THREAD_LIMIT;
@@ -455,9 +453,8 @@
     if (thread_socket_table[thread_num] < 0) {
         ap_sock_disable_nagle(csd);
     }
-    iol = ap_iol_attach_socket(p, sock);
     conn_io = ap_bcreate(p, B_RDWR);
-    ap_bpush_iol(conn_io, iol);
+    ap_bpush_socket(conn_io, sock);
 
     current_conn = ap_new_apr_connection(p, ap_server_conf, conn_io, sock,
                                          conn_id);
@@ -1346,7 +1343,7 @@
 
 static int pass_request(request_rec *r)
 {
-    apr_socket_t *thesock = ap_iol_get_socket(r->connection->client->iol);
+    apr_socket_t *thesock = r->connection->client->bsock;
     struct msghdr msg;
     struct cmsghdr *cmsg;
     int sfd;
@@ -1439,13 +1436,11 @@
 
     if (thread_socket_table[thread_num] != -1) {
         apr_socket_t *csd = NULL;
-        ap_iol *iol;
 
         apr_put_os_sock(&csd, &thread_socket_table[thread_num], 
                              r->connection->client->pool);
         ap_sock_disable_nagle(thread_socket_table[thread_num]);
-        iol = ap_iol_attach_socket(r->connection->client->pool, csd);
-        ap_bpush_iol(r->connection->client, iol);
+        ap_bpush_socket(r->connection->client, csd);
         return OK;
     }
     else {
Index: src/modules/mpm/prefork/prefork.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
retrieving revision 1.125
diff -u -d -b -w -u -r1.125 prefork.c
--- src/modules/mpm/prefork/prefork.c	2000/08/06 06:07:42	1.125
+++ src/modules/mpm/prefork/prefork.c	2000/08/19 18:26:17
@@ -103,7 +103,6 @@
 #include "ap_mpm.h"
 #include "unixd.h"
 #include "mpm_common.h"
-#include "ap_iol.h"
 #include "ap_listen.h"
 #include "ap_mmn.h"
 #ifdef HAVE_SYS_TYPES_H
@@ -748,7 +747,6 @@
     ap_listen_rec *first_lr;
     apr_pool_t *ptrans;
     conn_rec *current_conn;
-    ap_iol *iol;
     apr_status_t stat = APR_EINIT;
     int sockdes;
 
@@ -1022,13 +1020,12 @@
 
 	ap_sock_disable_nagle(sockdes);
 
-	iol = ap_iol_attach_socket(ptrans, csd);
 	(void) ap_update_child_status(my_child_num, SERVER_BUSY_READ,
 				   (request_rec *) NULL);
 
 	conn_io = ap_bcreate(ptrans, B_RDWR);
 
-	ap_bpush_iol(conn_io, iol);
+	ap_bpush_socket(conn_io, csd);
 
 	current_conn = ap_new_apr_connection(ptrans, ap_server_conf, conn_io, csd,
 					 my_child_num);
Index: src/modules/mpm/spmt_os2/spmt_os2.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c,v
retrieving revision 1.61
diff -u -d -b -w -u -r1.61 spmt_os2.c
--- src/modules/mpm/spmt_os2/spmt_os2.c	2000/08/06 06:07:42	1.61
+++ src/modules/mpm/spmt_os2/spmt_os2.c	2000/08/19 18:26:18
@@ -71,7 +71,6 @@
 #include "scoreboard.h"
 #include "ap_mpm.h"
 #include "ap_listen.h"
-#include "ap_iol.h"
 #include "apr_portable.h"
 #include "mpm_common.h"
 #include "apr_strings.h"
@@ -742,7 +741,6 @@
     ap_listen_rec *first_lr = NULL;
     apr_pool_t *ptrans;
     conn_rec *current_conn;
-    ap_iol *iol;
     apr_pool_t *pchild;
     parent_score *sc_parent_rec;
     int requests_this_child = 0;
@@ -968,20 +966,11 @@
 
 	ap_sock_disable_nagle(csd);
 
-        iol = ap_iol_attach_socket(ptrans, csd);
-
-	if (iol == NULL) {
-          ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, NULL,
-                       "error attaching to socket");
-	    apr_close_socket(csd);
-	    continue;
-        }
-
 	(void) ap_update_child_status(THREAD_GLOBAL(child_num), SERVER_BUSY_READ,
 				   (request_rec *) NULL);
 
 	conn_io = ap_bcreate(ptrans, B_RDWR);
-        ap_bpush_iol(conn_io, iol);
+        ap_bpush_socket(conn_io, csd);
 
 	current_conn = ap_new_apr_connection(ptrans, ap_server_conf, conn_io, csd,
                                              THREAD_GLOBAL(child_num));
Index: src/modules/mpm/winnt/mpm_winnt.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/mpm_winnt.c,v
retrieving revision 1.97
diff -u -d -b -w -u -r1.97 mpm_winnt.c
--- src/modules/mpm/winnt/mpm_winnt.c	2000/08/14 21:42:55	1.97
+++ src/modules/mpm/winnt/mpm_winnt.c	2000/08/19 18:26:20
@@ -70,7 +70,6 @@
 #include "ap_config.h"
 #include "ap_listen.h"
 #include "mpm_default.h"
-#include "ap_iol.h"
 #include "mpm_winnt.h"
 #include "mpm_common.h"
 
@@ -1103,7 +1102,6 @@
 
     while (1) {
         conn_rec *c;
-        ap_iol *iol;
         apr_int32_t disconnected;
 
         /* Grab a connection off the network */
@@ -1119,14 +1117,7 @@
         sock_disable_nagle(context->accept_socket);
         apr_put_os_sock(&context->sock, &context->accept_socket, context->ptrans);
 
-        iol = ap_iol_attach_socket(context->ptrans, context->sock);
-        if (iol == NULL) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, APR_ENOMEM, server_conf,
-                         "worker_main: attach_socket() failed. Continuing...");
-            closesocket(context->accept_socket);
-            continue;
-        }
-        ap_bpush_iol(context->conn_io, iol);
+        ap_bpush_socket(context->conn_io, context->sock);
         c = ap_new_connection(context->ptrans, server_conf, context->conn_io,
                               (struct sockaddr_in *) context->sa_client,
                               (struct sockaddr_in *) context->sa_server,
@@ -1137,11 +1128,13 @@
 
         apr_getsocketopt(context->sock, APR_SO_DISCONNECTED, &disconnected);
         if (disconnected) {
+            /* Without the iol's, I don't think we have to do anything here,
+             * but I leave this for a Windows expert.  rbb
+             */
             /* Kill the clean-up registered by the iol. We want to leave 
              * the accept socket open because we are about to try to 
              * reuse it
              */
-            ap_bpop_iol(&iol, context->conn_io);
         }
         else {
             context->accept_socket = INVALID_SOCKET;
Index: src/modules/proxy/proxy_connect.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_connect.c,v
retrieving revision 1.10
diff -u -d -b -w -u -r1.10 proxy_connect.c
--- src/modules/proxy/proxy_connect.c	2000/08/06 06:07:43	1.10
+++ src/modules/proxy/proxy_connect.c	2000/08/19 18:26:20
@@ -61,7 +61,6 @@
 #include "mod_proxy.h"
 #include "http_log.h"
 #include "http_main.h"
-#include "ap_iol.h"
 
 #ifdef HAVE_BSTRING_H
 #include <bstring.h>        /* for IRIX, FD_SET calls bzero() */
@@ -211,7 +210,7 @@
     }
 
     sock_buff = ap_bcreate(r->pool, B_RDWR);
-    ap_bpush_iol(sock_buff, ap_iol_attach_socket(sock));
+    ap_bpush_socket(sock_buff, sock);
 
     if(apr_setup_poll(&pollfd, 2, r->pool) != APR_SUCCESS)
     {
Index: src/modules/proxy/proxy_ftp.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_ftp.c,v
retrieving revision 1.15
diff -u -d -b -w -u -r1.15 proxy_ftp.c
--- src/modules/proxy/proxy_ftp.c	2000/08/06 06:07:44	1.15
+++ src/modules/proxy/proxy_ftp.c	2000/08/19 18:26:21
@@ -62,7 +62,6 @@
 #include "http_main.h"
 #include "http_log.h"
 #include "http_core.h"
-#include "ap_iol.h"
 
 #define AUTODETECT_PWD
 
@@ -589,7 +588,7 @@
     }
 
     f = ap_bcreate(p, B_RDWR);
-    ap_bpush_iol(f, ap_iol_attach_socket(sock));
+    ap_bpush_socket(f, sock);
 /* shouldn't we implement telnet control options here? */
 
 #ifdef CHARSET_EBCDIC
@@ -1146,11 +1145,11 @@
             }
         }
         data = ap_bcreate(p, B_RDWR);
-        ap_bpush_iol(f, ap_iol_attach_socket(csd));
+        ap_bpush_socket(f, csd);
     }
     else {
         data = ap_bcreate(p, B_RDWR);
-        ap_bpush_iol(data, ap_iol_attach_socket(dsock));
+        ap_bpush_socket(data, dsock);
     }
 
 /* send response */
Index: src/modules/proxy/proxy_http.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_http.c,v
retrieving revision 1.14
diff -u -d -b -w -u -r1.14 proxy_http.c
--- src/modules/proxy/proxy_http.c	2000/08/06 06:07:44	1.14
+++ src/modules/proxy/proxy_http.c	2000/08/19 18:26:22
@@ -63,7 +63,6 @@
 #include "http_main.h"
 #include "http_core.h"
 #include "util_date.h"
-#include "ap_iol.h"
 
 /*
  * Canonicalise http-like URLs.
@@ -269,7 +268,7 @@
     clear_connection(r->pool, r->headers_in);    /* Strip connection-based headers
*/
 
     f = ap_bcreate(p, B_RDWR);
-    ap_bpush_iol(f, ap_iol_attach_socket(sock));
+    ap_bpush_socket(f, sock);
 
     ap_bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.0" CRLF,
               NULL);
Index: src/modules/standard/mod_cgi.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgi.c,v
retrieving revision 1.56
diff -u -d -b -w -u -r1.56 mod_cgi.c
--- src/modules/standard/mod_cgi.c	2000/08/06 06:07:46	1.56
+++ src/modules/standard/mod_cgi.c	2000/08/19 18:26:22
@@ -309,7 +309,7 @@
     apr_proc_t *procnew = apr_pcalloc(p, sizeof(*procnew));
     apr_status_t rc = APR_SUCCESS;
     apr_file_t *file = NULL;
-    ap_iol *iol;
+    apr_file_t *sock = NULL;
 #if defined(RLIMIT_CPU)  || defined(RLIMIT_NPROC) || \
     defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
     core_dir_config *conf;
@@ -379,29 +379,42 @@
 
             /* Fill in BUFF structure for parents pipe to child's stdout */
             file = procnew->out;
-            iol = ap_create_file_iol(file);
-            if (!iol)
+            if (!file)
                 return APR_EBADF;
+            /* XXX This is a hack.  The correct solution is to create a
+             * pipe bucket, and just pass it down.  Since that bucket type
+             * hasn't been written, we can hack it for the moment.
+             */
+            apr_socket_from_file(&sock, file);
+
             *script_in = ap_bcreate(p, B_RD);
-            ap_bpush_iol(*script_in, iol);
+            ap_bpush_socket(*script_in, sock);
             ap_bsetopt(*script_in, BO_TIMEOUT, &r->server->timeout);
 
             /* Fill in BUFF structure for parents pipe to child's stdin */
             file = procnew->in;
-            iol = ap_create_file_iol(file);
-            if (!iol)
+            if (!file)
                 return APR_EBADF;
+            /* XXX This is a hack.  The correct solution is to create a
+             * pipe bucket, and just pass it down.  Since that bucket type
+             * hasn't been written, we can hack it for the moment.
+             */
+            apr_socket_from_file(&sock, file);
             *script_out = ap_bcreate(p, B_WR);
-            ap_bpush_iol(*script_out, iol);
+            ap_bpush_socket(*script_out, sock);
             ap_bsetopt(*script_out, BO_TIMEOUT, &r->server->timeout);
 
             /* Fill in BUFF structure for parents pipe to child's stderr */
             file = procnew->err;
-            iol = ap_create_file_iol(file);
-            if (!iol)
+            if (!file)
                 return APR_EBADF;
+            /* XXX This is a hack.  The correct solution is to create a
+             * pipe bucket, and just pass it down.  Since that bucket type
+             * hasn't been written, we can hack it for the moment.
+             */
+            apr_socket_from_file(&sock, file);
             *script_err = ap_bcreate(p, B_RD);
-            ap_bpush_iol(*script_err, iol);
+            ap_bpush_socket(*script_err, sock);
             ap_bsetopt(*script_err, BO_TIMEOUT, &r->server->timeout);
         }
     }
Index: src/modules/standard/mod_cgid.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgid.c,v
retrieving revision 1.36
diff -u -d -b -w -u -r1.36 mod_cgid.c
--- src/modules/standard/mod_cgid.c	2000/08/06 12:15:57	1.36
+++ src/modules/standard/mod_cgid.c	2000/08/19 18:26:23
@@ -89,7 +89,6 @@
 #include "http_conf_globals.h" 
 #include "buff.h" 
 #include "ap_mpm.h"
-#include "ap_iol.h"
 #include "unixd.h"
 #include <sys/stat.h>
 #ifdef HAVE_SYS_SOCKET_H
@@ -840,7 +839,6 @@
     struct sockaddr_un unix_addr;
     apr_socket_t *tempsock = NULL;
     int nbytes;
-    ap_iol *iol;
     script = ap_bcreate(r->pool, B_RDWR); 
 
     if (r->method_number == M_OPTIONS) { 
@@ -919,10 +917,8 @@
     send_req(sd, r, argv0, env); 
 
     apr_put_os_sock(&tempsock, &sd, pcgi);
-
-    iol = ap_iol_attach_socket(pcgi, tempsock);
 
-    ap_bpush_iol(script, iol); 
+    ap_bpush_socket(script, tempsock); 
 
     if ((retval = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) 
         return retval; 
Index: src/modules/standard/mod_include.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_include.c,v
retrieving revision 1.51
diff -u -d -b -w -u -r1.51 mod_include.c
--- src/modules/standard/mod_include.c	2000/08/07 20:11:37	1.51
+++ src/modules/standard/mod_include.c	2000/08/19 18:26:24
@@ -836,7 +836,7 @@
     apr_table_t *env = r->subprocess_env;
     char **argv;
     apr_file_t *file = NULL;
-    ap_iol *iol;
+    apr_socket_t *sock = NULL;
 #if defined(RLIMIT_CPU)  || defined(RLIMIT_NPROC) || \
     defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS)
     core_dir_config *conf; 
@@ -908,11 +908,15 @@
             apr_note_subprocess(r->pool, procnew, kill_after_timeout);
             /* Fill in BUFF structure for parents pipe to child's stdout */
             file = procnew->out;
-            iol = ap_create_file_iol(file);
-            if (!iol)
+            if (!file)
                 return APR_EBADF;
+            /* XXX This is a hack.  The correct solution is to create a 
+             * pipe bucket, and just pass it down.  Since that bucket type
+             * hasn't been written, we can hack it for the moment.
+             */ 
+            apr_socket_from_file(&sock, file);
             script_in = ap_bcreate(r->pool, B_RD);
-            ap_bpush_iol(script_in, iol);
+            ap_bpush_socket(script_in, sock);
             ap_send_fb(script_in, r);
             ap_bclose(script_in);
         }
Index: src/modules/standard/mod_mime_magic.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_mime_magic.c,v
retrieving revision 1.26
diff -u -d -b -w -u -r1.26 mod_mime_magic.c
--- src/modules/standard/mod_mime_magic.c	2000/08/06 06:07:47	1.26
+++ src/modules/standard/mod_mime_magic.c	2000/08/19 18:26:26
@@ -2149,7 +2149,7 @@
     apr_pool_t *child_context = cntxt;
     apr_procattr_t *procattr;
     apr_proc_t *procnew;
-    ap_iol *iol;
+    apr_socket_t *sock;
 
     env = ap_create_environment(child_context, r->subprocess_env);
 
@@ -2185,13 +2185,16 @@
         else {
             apr_note_subprocess(child_context, procnew, kill_after_timeout);
             /* Fill in BUFF structure for parents pipe to child's stdout */
-            iol = ap_create_file_iol(procnew->out);
-            if (!iol)
-                return APR_EBADF;
+            /* XXX This is a hack.  The correct solution is to create a
+             * pipe bucket, and just pass it down.  Since that bucket type
+             * hasn't been written, we can hack it for the moment.
+             */
+            apr_socket_from_file(&sock, procnew->out);
+
             if (script_in) {
                 *script_in = ap_bcreate(child_context, B_RD);
             }
-            ap_bpush_iol(*script_in, iol);
+            ap_bpush_socket(*script_in, sock);
         }
     }
 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message