You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2005/08/05 22:25:48 UTC

DO NOT REPLY [Bug 35025] - Keep alive in proxy_http.c is buggy

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35025>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35025





------- Additional Comments From lavr@ncbi.nlm.nih.gov  2005-08-05 22:25 -------
(In reply to comment #1)
> I am not sure how you want mod_proxy to change to 'fix' this?


Below is one of solutions that seems reasonable (although, I am
not very familiar with the code so it can perhaps be written
even better):


*** httpd-2.0.54/modules/proxy/proxy_http.c     Fri Feb  4 15:21:18 2005
--- proxy_http.c        Fri Aug  5 16:24:35 2005
*************** apr_status_t ap_proxy_http_determine_con
*** 237,242 ****
--- 237,259 ----
      return OK;
  }
  
+ 
+ static
+ apr_status_t address_match(const char*     hostip,
+                            apr_sockaddr_t* addrs)
+ {
+     apr_sockaddr_t* s = addrs;
+     while (s) {
+         char* ip;
+         apr_sockaddr_ip_get(&ip, s);
+         if (!apr_strnatcasecmp(hostip, ip))
+             return OK;
+         s = s->next;
+     }
+     return DONE;
+ }
+ 
+ 
  static
  apr_status_t ap_proxy_http_create_connection(apr_pool_t *p, request_rec *r,
                                               proxy_http_conn_t *p_conn,
*************** apr_status_t ap_proxy_http_create_connec
*** 264,270 ****
          if ((backend->connection->id == c->id) &&
              (backend->port == p_conn->port) &&
              (backend->hostname) &&
!             (!apr_strnatcasecmp(backend->hostname, p_conn->name))) {
              ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                           "proxy: keepalive address match (keep original 
socket)");
          } else {
--- 281,288 ----
          if ((backend->connection->id == c->id) &&
              (backend->port == p_conn->port) &&
              (backend->hostname) &&
!             (!apr_strnatcasecmp(backend->hostname, p_conn->name)) &&
!             address_match(backend->connection->remote_ip, p_conn->addr) == OK)
{
              ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                           "proxy: keepalive address match (keep original 
socket)");
          } else {


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org