From: William A. Rowe Jr Date: Mon, 15 Jul 2002 08:05:11 +0000 (+0000) Subject: http occurances to update for apr_socket_opt_get/set X-Git-Tag: 2.0.40~230 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed8fc9abaef1ff689c07588d2599be85353f0e86;p=apache http occurances to update for apr_socket_opt_get/set git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96057 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 9bbcdfcfd5..d55e893aa6 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -308,7 +308,7 @@ static int ap_process_http_connection(conn_rec *c) csd = ap_get_module_config(c->conn_config, &core_module); csd_set = 1; } - apr_setsocketopt(csd, APR_INCOMPLETE_READ, 1); + apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1); } return OK; diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index e05a92812c..5ae5b28a51 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -951,17 +951,18 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, #if !defined(TPF) && !defined(BEOS) if (conf->recv_buffer_size > 0 - && (rv = apr_setsocketopt(sock, APR_SO_RCVBUF, - conf->recv_buffer_size))) { + && (rv = apr_socket_opt_set(sock, APR_SO_RCVBUF, + conf->recv_buffer_size))) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default"); + "apr_socket_opt_set(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default"); } #endif - if (APR_SUCCESS != (rv = apr_setsocketopt(sock, APR_SO_REUSEADDR, one))) { + if ((rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, one)) + != APR_SUCCESS) { #ifndef _OSD_POSIX /* BS2000 has this option "always on" */ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "proxy: FTP: error setting reuseaddr option: setsockopt(SO_REUSEADDR)"); + "proxy: FTP: error setting reuseaddr option: apr_socket_opt_set(SO_REUSEADDR)"); return HTTP_INTERNAL_SERVER_ERROR; #endif /* _OSD_POSIX */ } @@ -1288,10 +1289,11 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, } #if !defined (TPF) && !defined(BEOS) - if (conf->recv_buffer_size > 0 && (rv = apr_setsocketopt(data_sock, APR_SO_RCVBUF, - conf->recv_buffer_size))) { + if (conf->recv_buffer_size > 0 + && (rv = apr_socket_opt_set(data_sock, APR_SO_RCVBUF, + conf->recv_buffer_size))) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "proxy: FTP: setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default"); + "proxy: FTP: apr_socket_opt_set(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default"); } #endif @@ -1374,10 +1376,11 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, } #if !defined (TPF) && !defined(BEOS) - if (conf->recv_buffer_size > 0 && (rv = apr_setsocketopt(data_sock, APR_SO_RCVBUF, - conf->recv_buffer_size))) { + if (conf->recv_buffer_size > 0 + && (rv = apr_socket_opt_set(data_sock, APR_SO_RCVBUF, + conf->recv_buffer_size))) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "proxy: FTP: setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default"); + "proxy: FTP: apr_socket_opt_set(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default"); } #endif @@ -1418,7 +1421,8 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, apr_sockaddr_port_get(&local_port, local_addr); apr_sockaddr_ip_get(&local_ip, local_addr); - if ((rv = apr_setsocketopt(local_sock, APR_SO_REUSEADDR, one)) != APR_SUCCESS) { + if ((rv = apr_socket_opt_set(local_sock, APR_SO_REUSEADDR, one)) + != APR_SUCCESS) { #ifndef _OSD_POSIX /* BS2000 has this option "always on" */ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: FTP: error setting reuseaddr option"); diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 3d0a4ffb90..d40abb873d 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1148,10 +1148,10 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock, #if !defined(TPF) && !defined(BEOS) if (conf->recv_buffer_size > 0 && - (rv = apr_setsocketopt(*newsock, APR_SO_RCVBUF, - conf->recv_buffer_size))) { + (rv = apr_socket_opt_set(*newsock, APR_SO_RCVBUF, + conf->recv_buffer_size))) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, - "setsockopt(SO_RCVBUF): Failed to set " + "apr_socket_opt_set(SO_RCVBUF): Failed to set " "ProxyReceiveBufferSize, using default"); } #endif diff --git a/server/connection.c b/server/connection.c index e960fc6c60..0cd03a72d8 100644 --- a/server/connection.c +++ b/server/connection.c @@ -180,7 +180,7 @@ AP_DECLARE(void) ap_lingering_close(conn_rec *c) */ timeout = apr_time_from_sec(SECONDS_TO_LINGER); apr_socket_timeout_set(csd, timeout); - apr_setsocketopt(csd, APR_INCOMPLETE_READ, 1); + apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1); while (1) { nbytes = sizeof(dummybuf); rc = apr_recv(csd, dummybuf, &nbytes); diff --git a/server/listen.c b/server/listen.c index 9e3701a5b0..ab7df87131 100644 --- a/server/listen.c +++ b/server/listen.c @@ -91,20 +91,20 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server) apr_status_t stat; #ifndef WIN32 - stat = apr_setsocketopt(s, APR_SO_REUSEADDR, one); + stat = apr_socket_opt_set(s, APR_SO_REUSEADDR, one); if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) { ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, - "make_sock: for address %pI, setsockopt: (SO_REUSEADDR)", + "make_sock: for address %pI, apr_socket_opt_set: (SO_REUSEADDR)", server->bind_addr); apr_socket_close(s); return stat; } #endif - stat = apr_setsocketopt(s, APR_SO_KEEPALIVE, one); + stat = apr_socket_opt_set(s, APR_SO_KEEPALIVE, one); if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) { ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, - "make_sock: for address %pI, setsockopt: (SO_KEEPALIVE)", + "make_sock: for address %pI, apr_socket_opt_set: (SO_KEEPALIVE)", server->bind_addr); apr_socket_close(s); return stat; @@ -130,7 +130,7 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server) * If no size is specified, use the kernel default. */ if (send_buffer_size) { - stat = apr_setsocketopt(s, APR_SO_SNDBUF, send_buffer_size); + stat = apr_socket_opt_set(s, APR_SO_SNDBUF, send_buffer_size); if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) { ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p, "make_sock: failed to set SendBufferSize for " @@ -172,10 +172,10 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server) * So set reuseaddr, but do not attempt to do so until we have the * parent listeners successfully bound. */ - stat = apr_setsocketopt(s, APR_SO_REUSEADDR, one); + stat = apr_socket_opt_set(s, APR_SO_REUSEADDR, one); if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) { ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, - "make_sock: for address %pI, setsockopt: (SO_REUSEADDR)", + "make_sock: for address %pI, apr_socket_opt_set: (SO_REUSEADDR)", server->bind_addr); apr_socket_close(s); return stat; diff --git a/server/mpm/experimental/threadpool/threadpool.c b/server/mpm/experimental/threadpool/threadpool.c index e1e1102058..c912a8d016 100644 --- a/server/mpm/experimental/threadpool/threadpool.c +++ b/server/mpm/experimental/threadpool/threadpool.c @@ -1958,7 +1958,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, #if APR_O_NONBLOCK_INHERITED for(lr = ap_listeners ; lr != NULL ; lr = lr->next) { - apr_setsocketopt(lr->sd, APR_SO_NONBLOCK, 1); + apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, 1); } #endif /* APR_O_NONBLOCK_INHERITED */ diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index 59abe96517..0eadf3ecdb 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -465,7 +465,7 @@ void worker_main(void *arg) /* If we got a new socket, set it to non-blocking mode and process it. Otherwise handle the error. */ if (stat == APR_SUCCESS) { - apr_setsocketopt(csd, APR_SO_NONBLOCK, 0); + apr_socket_opt_set(csd, APR_SO_NONBLOCK, 0); #ifdef DBINFO_ON if (wouldblock_retry < MAX_WB_RETRIES) { retry_success++; @@ -851,7 +851,7 @@ static int setup_listeners(server_rec *s) } /* Use non-blocking listen sockets so that we never get hung up. */ - apr_setsocketopt(lr->sd, APR_SO_NONBLOCK, 1); + apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, 1); } return 0; } diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index ee06c73d42..d414ddb9d7 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -1149,7 +1149,8 @@ static void worker_main(long thread_num) if (c) { ap_process_connection(c, context->sock); - apr_getsocketopt(context->sock, APR_SO_DISCONNECTED, &disconnected); + apr_socket_opt_get(context->sock, APR_SO_DISCONNECTED, + &disconnected); if (!disconnected) { context->accept_socket = INVALID_SOCKET; ap_lingering_close(c); diff --git a/server/mpm_common.c b/server/mpm_common.c index 1ebca2de64..da82267d66 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -314,11 +314,11 @@ void ap_sock_disable_nagle(apr_socket_t *s) * * In spite of these problems, failure here is not a shooting offense. */ - apr_status_t status = apr_setsocketopt(s, APR_TCP_NODELAY, 1); + apr_status_t status = apr_socket_opt_set(s, APR_TCP_NODELAY, 1); if (status != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, status, ap_server_conf, - "setsockopt: (TCP_NODELAY)"); + "apr_socket_opt_set: (TCP_NODELAY)"); } } #endif diff --git a/support/ab.c b/support/ab.c index 6734bfe728..3849d3c194 100644 --- a/support/ab.c +++ b/support/ab.c @@ -717,7 +717,7 @@ static void write_request(struct connection * c) #ifdef USE_SSL if (ssl != 1) #endif - apr_setsocketopt(c->aprsock, APR_SO_TIMEOUT, 0); + apr_socket_timeout_set(c->aprsock, 0); c->connect = tnow; c->rwrite = reqlen; c->rwrote = 0; @@ -1225,7 +1225,7 @@ static void start_connect(struct connection * c) SOCK_STREAM, c->ctx)) != APR_SUCCESS) { apr_err("socket", rv); } - if ((rv = apr_setsocketopt(c->aprsock, APR_SO_NONBLOCK, 1)) + if ((rv = apr_socket_opt_set(c->aprsock, APR_SO_NONBLOCK, 1)) != APR_SUCCESS) { apr_err("socket nonblock", rv); } @@ -1726,14 +1726,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.110 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.111 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AP_AB_BASEREVISION, "$Revision: 1.110 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AP_AB_BASEREVISION, "$Revision: 1.111 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n");