httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1724886 - /httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c
Date Fri, 15 Jan 2016 22:11:03 GMT
Author: jim
Date: Fri Jan 15 22:11:02 2016
New Revision: 1724886

URL: http://svn.apache.org/viewvc?rev=1724886&view=rev
Log:
Avoid having to recheck DNS

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c?rev=1724886&r1=1724885&r2=1724886&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c Fri Jan 15 22:11:02 2016
@@ -314,7 +314,7 @@ static apr_status_t hc_check_tcp(sctx_t
             ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ctx->s, APLOGNO() "Cannot init worker");
             return rv;
         }
-        err = apr_sockaddr_info_get(&(cp->addr), worker->s->hostname, APR_UNSPEC,
+        err = apr_sockaddr_info_get(&(worker->cp->addr), worker->s->hostname,
APR_UNSPEC,
                                     worker->s->port, 0, ctx->p);
 
         if (err != APR_SUCCESS) {
@@ -324,7 +324,7 @@ static apr_status_t hc_check_tcp(sctx_t
             return err;
         }
     }
-    backend = (proxy_conn_rec *) apr_palloc(p, sizeof(proxy_conn_rec));
+    cp->addr = worker->cp->addr;
     status = ap_proxy_acquire_connection("HCTCP", &backend, ctx->hc, ctx->s);
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ctx->s, APLOGNO()
                      "ap_proxy_acquire_connection (%d).", status);
@@ -342,8 +342,8 @@ static apr_status_t hc_check_tcp(sctx_t
     ctx->hc->cp = cp;
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ctx->s, APLOGNO()
                      "Health check TCP Status (%d).", status);
+    backend_cleanup("HCTCP", backend, ctx->s);
     if (status != OK) {
-        backend_cleanup("HCTCP", backend, ctx->s);
         return APR_EGENERAL;
     }
     return APR_SUCCESS;



Mime
View raw message