Re: Apache (base) and proxy_module

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Björn Ketelaars
Date: Tuesday, November 23, 2010 - 6:03 am

2010/11/23 Bjvrn Ketelaars <bjorn.ketelaars@hydroxide.nl>:
NULL);
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/httpd/src/modules/proxy/pr
oxy_http.c

I believe I made a mistake:

destportstr != NULL => will be evaluated as true when a port is given.

destport != DEFAULT_HTTP_PORT => will ALWAYS be evaluated as false
because in line 118 (proxy_http.c) destport is set to
DEFAULT_HTTP_PORT and never changes. What really has to be compared is
the value of destportstr with destport (or DEFAULT_HTTP_PORT). So the
expression should be:

atoi(destportstr) != destport

New diff:

# diff -u proxy_http.c.orig proxy_http.c
--- proxy_http.c.orig   Tue Nov 23 12:05:25 2010
+++ proxy_http.c        Tue Nov 23 14:00:15 2010
@@ -367,7 +367,7 @@
                    AP_HOOK_DECLINE(DECLINED),
                    &rc, r, f, desthost, destportstr, destportstr);
         if (rc == DECLINED) {
-           if (destportstr != NULL && destport != DEFAULT_HTTP_PORT)
+           if (destportstr != NULL && atoi(destportstr) != destport)
                ap_bvputs(f, "Host: ", desthost, ":", destportstr, CRLF,
NULL);
            else
                ap_bvputs(f, "Host: ", desthost, CRLF, NULL);

What do you think?
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Apache (base) and proxy_module, Björn Ketelaars, (Tue Nov 23, 5:17 am)
Re: Apache (base) and proxy_module, Дмитрий Ð¦Ð°Ñ ..., (Tue Nov 23, 5:43 am)
Re: Apache (base) and proxy_module, Дмитрий Ð¦Ð°Ñ ..., (Tue Nov 23, 5:45 am)
Re: Apache (base) and proxy_module, Björn Ketelaars, (Tue Nov 23, 6:03 am)