]> granicus.if.org Git - apache/commitdiff
http occurances to update for apr_socket_opt_get/set
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 15 Jul 2002 08:05:11 +0000 (08:05 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 15 Jul 2002 08:05:11 +0000 (08:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96057 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_core.c
modules/proxy/proxy_ftp.c
modules/proxy/proxy_util.c
server/connection.c
server/listen.c
server/mpm/experimental/threadpool/threadpool.c
server/mpm/netware/mpm_netware.c
server/mpm/winnt/mpm_winnt.c
server/mpm_common.c
support/ab.c

index 9bbcdfcfd5feada789b5e7143e0285d0901d42d1..d55e893aa68870e108095a7d66474f4160829a25 100644 (file)
@@ -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;
index e05a92812cb9e13c1e619545265f51654601803c..5ae5b28a51b6a6d9985f05063128a299de356160 100644 (file)
@@ -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");
index 3d0a4ffb9076871004997cd562ce5069d4275fd2..d40abb873de275e87191b890b3636fd70d6fbc35 100644 (file)
@@ -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
index e960fc6c605ba6baf3c2677b283fe89e665dde63..0cd03a72d81f044b72558e3a49e6a99e273c8e60 100644 (file)
@@ -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);
index 9e3701a5b0d0a8cb3a4952f033ac7536af0fa7a3..ab7df871314c83a7f2b1efc2cb456d1cf6147e8a 100644 (file)
@@ -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;
index e1e11020584ff459ccbba6a4aea0a0c2d22d5219..c912a8d016fb9aadd85f042f681a6a30eecd07d4 100644 (file)
@@ -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 */
 
index 59abe9651721b197c919d58964a5b7e5fee06782..0eadf3ecdb0f6152d934df512260e73bdf434c25 100644 (file)
@@ -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;
 }
index ee06c73d4283e1af41c2961f83a67aca0561ac9a..d414ddb9d71c5e36f57e228092a0669642dc949c 100644 (file)
@@ -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);
index 1ebca2de64fbb8f8a908b11ad9c683591de13361..da82267d6608195463fcbde19c0c3e2a85b95c96 100644 (file)
@@ -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
index 6734bfe7281968d9851fcb66a982617ee11e1b20..3849d3c1949888170bdb8c74276b1e2bf95138a8 100644 (file)
@@ -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("<p>\n");
-       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.110 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.111 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");