]> granicus.if.org Git - apache/commitdiff
Add a timeout when making connections from within the proxy.
authorVictor J. Orlikowski <orlikowski@apache.org>
Fri, 3 Aug 2001 18:00:38 +0000 (18:00 +0000)
committerVictor J. Orlikowski <orlikowski@apache.org>
Fri, 3 Aug 2001 18:00:38 +0000 (18:00 +0000)
Now, if someone wants to add a special scoreboard state for proxy
attempting to make connection, be my guest.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89908 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_connect.c
modules/proxy/proxy_ftp.c
modules/proxy/proxy_http.c

index e238c66fdc26d7b420010360dd2eb1a6c6d64f04..c63c33ff30bab74f81ebbeea631c4a2d8d2b7e4e 100644 (file)
@@ -222,6 +222,9 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf,
         return HTTP_INTERNAL_SERVER_ERROR;
     }
 
+    /* Set a timeout on the socket */
+    apr_setsocketopt(sock, APR_SO_TIMEOUT, (int)(r->server->timeout * APR_USEC_PER_SEC));
+
        /*
         * At this point we have a list of one or more IP addresses of
         * the machine to connect to. If configured, reorder this
index 2605b95d10466379d7501a577379740e8f60b313..ec39ce1a4adda470702ed69213dacf1253ab3894 100644 (file)
@@ -696,6 +696,9 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
 #endif /*_OSD_POSIX*/
     }
 
+    /* Set a timeout on the socket */
+    apr_setsocketopt(sock, APR_SO_TIMEOUT, (int)(r->server->timeout * APR_USEC_PER_SEC));
+
     ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
                 "proxy: FTP: socket has been created");
 
index fd2edfa770332ecdb931900e2899bf3e757b4efc..184c8c7844d116743d3e7986e97f68c192ef62d7 100644 (file)
@@ -377,6 +377,9 @@ int ap_proxy_http_handler(request_rec *r, proxy_server_conf *conf,
        }
 #endif
 
+        /* Set a timeout on the socket */
+        apr_setsocketopt(sock, APR_SO_TIMEOUT, (int)(r->server->timeout * APR_USEC_PER_SEC));
+
        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
                     "proxy: socket has been created");