From: Ryan Bloom Date: Fri, 30 Jun 2000 18:08:13 +0000 (+0000) Subject: Combine some common code. Before this, all platforms implemented their X-Git-Tag: APACHE_2_0_ALPHA_5~209 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=114fb2e4acb4645a6aa26a6cc490f9129feb29ae;p=thirdparty%2Fapache%2Fhttpd.git Combine some common code. Before this, all platforms implemented their own iol_sockets using APR. This just combines all of that code to a common file and moves that file to main. I have tested this with all of the Unix MPM's, but I am willing to bet I missed something (Makefiles) for Windows, and possibly moving some code for OS/2 and BeOS. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85732 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 732fec5aacb..e3cf754a0c0 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -898,7 +898,7 @@ static int cgid_handler(request_rec *r) ap_put_os_sock(&tempsock, &sd, pcgi); - iol = unix_attach_socket(tempsock); + iol = ap_iol_attach_socket(tempsock); ap_bpush_iol(script, iol); diff --git a/modules/proxy/proxy_connect.c b/modules/proxy/proxy_connect.c index bc2b1018066..a7811aef6a8 100644 --- a/modules/proxy/proxy_connect.c +++ b/modules/proxy/proxy_connect.c @@ -211,7 +211,7 @@ int ap_proxy_connect_handler(request_rec *r, ap_cache_el *c, char *url, } sock_buff = ap_bcreate(r->pool, B_RDWR); - ap_bpush_iol(sock_buff, unix_attach_socket(sock)); + ap_bpush_iol(sock_buff, ap_iol_attach_socket(sock)); if(ap_setup_poll(&pollfd, 2, r->pool) != APR_SUCCESS) { diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index 7bf446d43b5..15c9e40b68c 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -589,7 +589,7 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el *c, char *url) } f = ap_bcreate(p, B_RDWR); - ap_bpush_iol(f, unix_attach_socket(sock)); + ap_bpush_iol(f, ap_iol_attach_socket(sock)); /* shouldn't we implement telnet control options here? */ #ifdef CHARSET_EBCDIC @@ -1146,11 +1146,11 @@ int ap_proxy_ftp_handler(request_rec *r, ap_cache_el *c, char *url) } } data = ap_bcreate(p, B_RDWR); - ap_bpush_iol(f, unix_attach_socket(csd)); + ap_bpush_iol(f, ap_iol_attach_socket(csd)); } else { data = ap_bcreate(p, B_RDWR); - ap_bpush_iol(data, unix_attach_socket(dsock)); + ap_bpush_iol(data, ap_iol_attach_socket(dsock)); } /* send response */ diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 800734f5c4b..e22ef00e6c2 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -269,7 +269,7 @@ int ap_proxy_http_handler(request_rec *r, ap_cache_el *c, char *url, clear_connection(r->pool, r->headers_in); /* Strip connection-based headers */ f = ap_bcreate(p, B_RDWR); - ap_bpush_iol(f, unix_attach_socket(sock)); + ap_bpush_iol(f, ap_iol_attach_socket(sock)); ap_bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.0" CRLF, NULL); diff --git a/os/unix/Makefile.in b/os/unix/Makefile.in index 3f95e080a79..63596967db1 100644 --- a/os/unix/Makefile.in +++ b/os/unix/Makefile.in @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libos.la -LTLIBRARY_SOURCES = os-inline.c unixd.c iol_socket.c +LTLIBRARY_SOURCES = os-inline.c unixd.c include $(top_srcdir)/build/ltlib.mk diff --git a/server/Makefile.in b/server/Makefile.in index a3f75f421fb..7ebf0190d53 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -7,8 +7,8 @@ LTLIBRARY_SOURCES = \ 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 listen.c mpm_common.c \ - util_charset.c util_debug.c + rfc1413.c http_connection.c iol_file.c iol_socket.c listen.c \ + mpm_common.c util_charset.c util_debug.c include $(top_srcdir)/build/ltlib.mk diff --git a/server/mpm/beos/beos.c b/server/mpm/beos/beos.c index 0419f66846e..bb150ccbdfe 100644 --- a/server/mpm/beos/beos.c +++ b/server/mpm/beos/beos.c @@ -393,7 +393,7 @@ static void process_socket(ap_pool_t *p, ap_socket_t *sock, int my_child_num) return; } - iol = beos_attach_socket(sock); + iol = ap_iol_attach_socket(sock); if (iol == NULL) { ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL, "error attaching to socket"); diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index 7a444b9be6d..039d2c80d19 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -509,7 +509,7 @@ static void process_socket(ap_pool_t *p, ap_socket_t *sock, long conn_id) } sock_disable_nagle(csd); - iol = unix_attach_socket(sock); + iol = ap_iol_attach_socket(sock); conn_io = ap_bcreate(p, B_RDWR); ap_bpush_iol(conn_io, iol); diff --git a/server/mpm/mpmt_beos/mpmt_beos.c b/server/mpm/mpmt_beos/mpmt_beos.c index adc0538681e..802a4c06d9f 100644 --- a/server/mpm/mpmt_beos/mpmt_beos.c +++ b/server/mpm/mpmt_beos/mpmt_beos.c @@ -370,7 +370,7 @@ static void process_socket(ap_pool_t *p, ap_socket_t *sock, int my_child_num, in long conn_id = my_child_num * HARD_THREAD_LIMIT + my_thread_num; int csd; - iol = beos_attach_socket(sock); + iol = ap_iol_attach_socket(sock); if (iol == NULL) { if (errno == EBADF) { ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, NULL, diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 3b3a78ba216..8d2f29d7aa1 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -504,7 +504,7 @@ static void process_socket(ap_pool_t *p, ap_socket_t *sock, int my_child_num, in sock_disable_nagle(csd); - iol = unix_attach_socket(sock); + iol = ap_iol_attach_socket(sock); (void) ap_update_child_status(my_child_num, my_thread_num, SERVER_BUSY_READ, (request_rec *) NULL); diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 5a4f1d64e09..c4279ba4811 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -1039,7 +1039,7 @@ static void child_main(int child_num_arg) sock_disable_nagle(sockdes); - iol = unix_attach_socket(csd); + iol = ap_iol_attach_socket(csd); (void) ap_update_child_status(my_child_num, SERVER_BUSY_READ, (request_rec *) NULL); diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 0d707c22bbb..38a8cadf44b 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -994,7 +994,7 @@ static void child_main(void *child_num_arg) sock_disable_nagle(csd); - iol = os2_attach_socket(csd); + iol = ap_iol_attach_socket(csd); if (iol == NULL) { ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, NULL, diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 616a17048e9..492ab748ea7 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -1085,7 +1085,7 @@ static void worker_main(int child_num) sock_disable_nagle(context->accept_socket); ap_put_os_sock(&context->sock, &context->accept_socket, context->ptrans); - iol = win32_attach_socket(context->ptrans, context->sock); + iol = ap_iol_attach_socket(context->sock); if (iol == NULL) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_ENOMEM, server_conf, "worker_main: attach_socket() failed. Continuing...");