PATCH: various mod_proxy issues

PATCH: various mod_proxy issues

am 26.06.2004 08:48:26 von Nick Kew

This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---1463810294-1627417438-1088232129=:26894
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID:


I've rolled a fairly extensive mod_proxy patch, which seems rather
big to commit without review. Comments please:

(1) Bug #10722 - cookie paths and domains in reverse proxy

Following my patch to 2.0.49, I've adapted it for 2.1, taking into account
Jim's patch. In doing so, I made some organisational changes:

* moved rewriting of headers that need it (ap_proxy_date_canon and
ap_proxy_location_reverse_map) to a new function process_proxy_header
called from ap_proxy_read_headers.
* Removed the same from ap_proxy_http_process_response
* moved ap_proxy_read_headers from proxy_utils to proxy_http
* Retained Jim's patch, but removed the line merging err_headers_out


(2) Bug #29554 - URL munging

I've ported Francois-Rene Rideau's patch to 2.1, subject to the
question over proxy_fixup discussed in my last post.


Any problems with committing this?

--
Nick Kew
---1463810294-1627417438-1088232129=:26894
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=proxy-patch
Content-Transfer-Encoding: BASE64
Content-ID:
Content-Description: proposed patch
Content-Disposition: ATTACHMENT; FILENAME=proxy-patch

ZGlmZiAtdSBwcm94eS1vbGQvbW9kX3Byb3h5LmMgcHJveHkvbW9kX3Byb3h5
LmMNCi0tLSBwcm94eS1vbGQvbW9kX3Byb3h5LmMJMjAwNC0wNi0yNiAwNzox
ODoxMC4wMDAwMDAwMDAgKzAxMDANCisrKyBwcm94eS9tb2RfcHJveHkuYwky
MDA0LTA2LTI2IDA3OjEzOjQ2LjAwMDAwMDAwMCArMDEwMA0KQEAgLTk0LDkg
Kzk0LDEwIEBADQogc3RhdGljIGludCBwcm94eV9kZXRlY3QocmVxdWVzdF9y
ZWMgKnIpDQogew0KICAgICB2b2lkICpzY29uZiA9IHItPnNlcnZlci0+bW9k
dWxlX2NvbmZpZzsNCi0gICAgcHJveHl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g
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHItPnVucGFyc2Vk
X3VyaSArIGxlbiwgTlVMTCk7DQorICAgICAgICAgICAgICAgIHItPmhhbmRs
ZXIgPSAicHJveHktc2VydmVyIjsNCisgICAgICAgICAgICAgICAgci0+cHJv
eHlyZXEgPSBQUk9YWVJFUV9SRVZFUlNFOw0KKyAgICAgICAgICAgICAgICBy
LT51cmkgPSByLT51bnBhcnNlZF91cmk7DQorICAgICAgICAgICAgICAgIGJy
ZWFrOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCiAgICAgfQ0KICAg
ICByZXR1cm4gREVDTElORUQ7DQogfQ0KQEAgLTE0MCwyNiArMTU0LDYgQEAN
CiAgICAgICAgIHJldHVybiBPSzsNCiAgICAgfQ0KIA0KLSAgICAvKiBYWFg6
IHNpbmNlIHItPnVyaSBoYXMgYmVlbiBtYW5pcHVsYXRlZCBhbHJlYWR5IHdl
J3JlIG5vdCByZWFsbHkNCi0gICAgICogY29tcGxpYW50IHdpdGggUkZDMTk0
NSBhdCB0aGlzIHBvaW50LiAgQnV0IHRoaXMgcHJvYmFibHkgaXNuJ3QNCi0g
ICAgICogYW4gaXNzdWUgYmVjYXVzZSB0aGlzIGlzIGEgaHlicmlkIHByb3h5
L29yaWdpbiBzZXJ2ZXIuDQotICAgICAqLw0KLQ0KLSAgICBmb3IgKGkgPSAw
OyBpIDwgY29uZi0+YWxpYXNlcy0+bmVsdHM7IGkrKykgew0KLSAgICAgICAg
bGVuID0gYWxpYXNfbWF0Y2goci0+dXJpLCBlbnRbaV0uZmFrZSk7DQotDQot
ICAgICAgIGlmIChsZW4gPiAwKSB7DQotICAgICAgICAgICBpZiAoKGVudFtp
XS5yZWFsWzBdID09ICchJyApICYmICggZW50W2ldLnJlYWxbMV0gPT0gMCAp
KSB7DQotICAgICAgICAgICAgICAgcmV0dXJuIERFQ0xJTkVEOw0KLSAgICAg
ICAgICAgfQ0KLQ0KLSAgICAgICAgICAg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uZi0+Y29va2llX3BhdGhzLT5lbHRzOw0KKyAgICAgICAgZm9yIChpID0g
MDsgaSA8IGNvbmYtPmNvb2tpZV9wYXRocy0+bmVsdHM7IGkrKykgew0KKyAg
ICAgICAgICAgIGwyID0gc3RybGVuKGVudFtpXS5mYWtlKTsNCisgICAgICAg
ICAgICBpZiAobDEgPj0gbDIgJiYgc3RybmNtcChlbnRbaV0uZmFrZSwgcGF0
aHAsIGwyKSA9PSAwKSB7DQorICAgICAgICAgICAgICAgIG5ld3BhdGggPSBl
bnRbaV0ucmVhbCA7DQorICAgICAgICAgICAgICAgIHBkaWZmID0gc3RybGVu
KG5ld3BhdGgpIC0gbDEgOw0KKyAgICAgICAgICAgICAgICBicmVhayA7DQor
ICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorICAgIGlmICgg
ZG9tYWlucCA9IGFwcl9zdHJtYXRjaChjb25mLT5jb29raWVfZG9tYWluX3N0
ciwgc3RyLCBsZW4pICwgZG9tYWlucCApIHsNCisgICAgICAgIGRvbWFpbnAg
Kz0gNyA7DQorICAgICAgICBkb2ZmcyA9IGRvbWFpbnAgLSBzdHIgOw0KKyAg
ICAgICAgZG9tYWluZSA9IHN0cmNocihkb21haW5wLCAnOycpIDsNCisgICAg
ICAgIGwxID0gZG9tYWluZSA/IChkb21haW5lLWRvbWFpbnApIDogc3RybGVu
KGRvbWFpbnApIDsNCisgICAgICAgIGRvbWFpbmUgPSBkb21haW5wICsgbDEg
Ow0KKyAgICAgICAgZW50ID0gKHN0cnVjdCBwcm94eV9hbGlhcyAqKWNvbmYt
PmNvb2tpZV9kb21haW5zLT5lbHRzOw0KKyAgICAgICAgZm9yIChpID0gMDsg
aSA8IGNvbmYtPmNvb2tpZV9kb21haW5zLT5uZWx0czsgaSsrKSB7DQorICAg
ICAgICAgICAgbDIgPSBzdHJsZW4oZW50W2ldLmZha2UpOw0KKyAgICAgICAg
ICAgIGlmIChsMSA+PSBsMiAmJiBzdHJuY21wKGVudFtpXS5mYWtlLCBkb21h
aW5wLCBsMikgPT0gMCkgew0KKyAgICAgICAgICAgICAgICBuZXdkb21haW4g
PSBlbnRbaV0ucmVhbCA7DQorICAgICAgICAgICAgICAgIGRkaWZmID0gc3Ry
bGVuKG5ld2RvbWFpbikgLSBsMSA7DQorICAgICAgICAgICAgICAgIGJyZWFr
IDsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisgICAg
aWYgKCBuZXdwYXRoICkgew0KKyAgICAgICAgcmV0ID0gYXByX3BhbGxvYyhy
LT5wb29sLCBsZW4rcGRpZmYrZGRpZmYrMSkgOw0KKyAgICAgICAgbDEgPSBz
dHJsZW4obmV3cGF0aCkgOw0KKyAgICAgICAgaWYgKCBuZXdkb21haW4gKSB7
DQorICAgICAgICAgICAgbDIgPSBzdHJsZW4obmV3ZG9tYWluKSA7DQorICAg
ICAgICAgICAgaWYgKCBkb2ZmcyA+IHBvZmZzICkgew0KKyAgICAgICAgICAg
ICAgICBtZW1jcHkocmV0LCBzdHIsIHBvZmZzKSA7DQorICAgICAgICAgICAg
ICAgIG1lbWNweShyZXQrcG9mZnMsIG5ld3BhdGgsIGwxKSA7DQorICAgICAg
ICAgICAgICAgIG1lbWNweShyZXQrcG9mZnMrbDEsIHBhdGhlLCBkb21haW5w
LXBhdGhlKSA7DQorICAgICAgICAgICAgICAgIG1lbWNweShyZXQrZG9mZnMr
cGRpZmYsIG5ld2RvbWFpbiwgbDIpIDsNCisgICAgICAgICAgICAgICAgc3Ry
Y3B5KHJldCtkb2ZmcytwZGlmZitsMiwgZG9tYWluZSkgOw0KKyAgICAgICAg
ICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgIG1lbWNweShyZXQsIHN0
ciwgZG9mZnMpIDsNCisgICAgICAgICAgICAgICAgbWVtY3B5KHJldCtkb2Zm
cywgbmV3ZG9tYWluLCBsMikgOw0KKyAgICAgICAgICAgICAgICBtZW1jcHko
cmV0K2RvZmZzK2wyLCBkb21haW5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vdXQs
IHRoZW4NCisgICAgICAgICAgICAgICAgICAgICAqIHJldHVybiB3aGF0IHdl
J3ZlIGFjY3VtdWxhdGVkIHNvIGZhciwgaW4gdGhlIGhvcGVzDQorICAgICAg
ICAgICAgICAgICAgICAgKiB0aGF0IHRoZXkgYXJlIHVzZWZ1bC4gT3RoZXJ3
aXNlLCB3ZSBjb21wbGV0ZWx5IGJhaWwuDQorICAgICAgICAgICAgICAgICAg
ICAgKi8NCisgICAgICAgICAgICAgICAgICAgIC8qIEZJWE1FOiBXZSd2ZSBh
bHJlYWR5IHNjYXJmZWQgdGhlIHN1cHBvc2VkIDFzdCBsaW5lIG9mDQorICAg
ICAgICAgICAgICAgICAgICAgKiB0aGUgYm9keSwgc28gdGhlIGFjdHVhbCBj
b250ZW50IG1heSBlbmQgdXAgYmVpbmcgYm9ndXMNCisgICAgICAgICAgICAg
ICAgICAgICAqIGFzIHdlbGwuIElmIHRoZSBjb250ZW50IGlzIEhUTUwsIHdl
IG1heSBiZSBsdWNreS4NCisgICAgICAgICAgICAgICAgICAgICAqLw0KKyAg
ICAgICAgICAgICAgICAgICAgaWYgKHNhd19oZWFkZXJzKSB7DQorICAgICAg
ICAgICAgICAgICAgICAgICAgYXBfbG9nX2Vycm9yKEFQTE9HX01BUkssIEFQ
TE9HX1dBUk5JTkcsIDAsIHItPnNlcnZlciwNCisgICAgICAgICAgICAgICAg
ICAgICAgICAgInByb3h5OiBTdGFydGluZyBib2R5IGR1ZSB0byBib2d1cyBu
b24taGVhZGVyIGluIGhlYWRlcnMgIg0KKyAgICAgICAgICAgICAgICAgICAg
ICAgICAicmV0dXJuZWQgYnkgJXMgKCVzKSIsIHItPnVyaSwgci0+bWV0aG9k
KTsNCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gOw0KKyAgICAg
ICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAg
ICAgICAgYXBfbG9nX2Vycm9yKEFQTE9HX01BUkssIEFQTE9HX1dBUk5JTkcs
IDAsIHItPnNlcnZlciwNCisgICAgICAgICAgICAgICAgICAgICAgICAgInBy
b3h5OiBObyBIVFRQIGhlYWRlcnMgIg0KKyAgICAgICAgICAgICAgICAgICAg
ICAgICAicmV0dXJuZWQgYnkgJXMgKCVzKSIsIHItPnVyaSwgci0+bWV0aG9k
KTsNCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gOw0KKyAgICAg
ICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB9DQorICAgICAg
ICAgICAgfQ0KKyAgICAgICAgICAgIC8qIHRoaXMgaXMgdGhlIHBzYy0+YmFk
b3B0ID09IGJhZF9pZ25vcmUgY2FzZSAqLw0KKyAgICAgICAgICAgIGFwX2xv
Z19lcnJvcihBUExPR19NQVJLLCBBUExPR19XQVJOSU5HLCAwLCByLT5zZXJ2
ZXIsDQorICAgICAgICAgICAgICAgICAgICAgICAgICJwcm94eTogSWdub3Jp
bmcgYm9ndXMgSFRUUCBoZWFkZXIgIg0KKyAgICAgICAgICAgICAgICAgICAg
ICAgICAicmV0dXJuZWQgYnkgJXMgKCVzKSIsIHItPnVyaSwgci0+bWV0aG9k
KTsNCisgICAgICAgICAgICBjb250aW51ZTsNCisgICAgICAgIH0NCisNCisg
ICAgICAgICp2YWx1ZSA9ICdcMCc7DQorICAgICAgICArK3ZhbHVlOw0KKyAg
ICAgICAgLyogWFhYOiBSRkMyMDY4IGRlZmluZXMgb25seSBTUCBhbmQgSFQg
YXMgd2hpdGVzcGFjZSwgdGhpcyB0ZXN0IGlzDQorICAgICAgICAgKiB3cm9u
Zy4uLiBhbmQgc28gYXJlIG1hbnkgb3RoZXJzIHByb2JhYmx5Lg0KKyAgICAg
ICAgICovDQorICAgICAgICB3aGlsZSAoYXByX2lzc3BhY2UoKnZhbHVlKSkN
CisgICAgICAgICAgICArK3ZhbHVlOyAgICAgICAgICAgIC8qIFNraXAgdG8g
c3RhcnQgb2YgdmFsdWUgICAqLw0KKw0KKy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dCB0aGUgbGFy
Z2VyIGxvb3AgYXMgd2VsbCAqLw0KKyAgICAgICAgICAgICAgICBicmVhazsN
CisgICAgICAgIH0NCisgICAgfQ0KK30NCisNCisNCiANCiBzdGF0aWMgaW50
IGFkZGl0X2RhbW1pdCh2b2lkICp2LCBjb25zdCBjaGFyICprZXksIGNvbnN0
IGNoYXIgKnZhbCkNCiB7DQpAQCAtODUwLDEzICsxMDc3LDExIEBADQogDQog
ICAgICAgICAgICAgLyogRmlyc3QsIHR1Y2sgYXdheSBhbGwgYWxyZWFkeSBl
eGlzdGluZyBjb29raWVzICovDQogICAgICAgICAgICAgc2F2ZV90YWJsZSA9
IGFwcl90YWJsZV9tYWtlKHItPnBvb2wsIDIpOw0KLSAgICAgICAgICAgIGFw
cl90YWJsZV9kbyhhZGRpdF9kYW1taXQsIHNhdmVfdGFibGUsIHItPmVycl9o
ZWFkZXJzX291dCwNCi0gICAgICAgICAgICAgICAgICAgICAgICAgIlNldC1D
b29raWUiLCBOVUxMKTsNCiAgICAgICAgICAgICBhcHJfdGFibGVfZG8oYWRk
aXRfZGFtbWl0LCBzYXZlX3RhYmxlLCByLT5oZWFkZXJzX291dCwNCiAgICAg
ICAgICAgICAgICAgICAgICAgICAgIlNldC1Db29raWUiLCBOVUxMKTsNCiAN
Ci0gICAgICAgICAgICByLT5oZWFkZXJzX291dCA9IGFwX3Byb3h5X3JlYWRf
aGVhZGVycyhyLCBycCwgYnVmZmVyLA0KLSAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihidWZmZXIp
LCBvcmlnaW4pOw0KKwkgICAgLyogc2hvdmUgdGhlIGhlYWRlcnMgZGlyZWN0
IGludG8gci0+aGVhZGVyc19vdXQgKi8NCisgICAgICAgICAgICBhcF9wcm94
eV9yZWFkX2hlYWRlcnMociwgcnAsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlciks
IG9yaWdpbik7DQogDQogICAgICAgICAgICAgaWYgKHItPmhlYWRlcnNfb3V0
ID09IE5VTEwpIHsNCiAgICAgICAgICAgICAgICAgYXBfbG9nX2Vycm9yKEFQ
TE9HX01BUkssIEFQTE9HX1dBUk5JTkcsIDAsDQpAQCAtOTQ2LDQyICsxMTcx
LDkgQEANCiAgICAgICAgICAgICAgICAgICAgICAgICAgInByb3h5OiBIVFRQ
OiByZWNlaXZlZCBpbnRlcmltICVkIHJlc3BvbnNlIiwNCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgci0+c3RhdHVzKTsNCiAgICAgICAgIH0NCi0NCi0g
ICAgICAgIC8qIHdlIG11c3QgYWNjZXB0IDMga2luZHMgb2YgZGF0ZSwgYnV0
IGdlbmVyYXRlIG9ubHkgMSBraW5kIG9mIGRhdGUgKi8NCi0gICAgICAgIHsN
Ci0gICAgICAgICAgICBjb25zdCBjaGFyICpidWY7DQotICAgICAgICAgICAg
aWYgKChidWYgPSBhcHJfdGFibGVfZ2V0KHItPmhlYWRlcnNfb3V0LCAiRGF0
ZSIpKSAhPSBOVUxMKSB7DQotICAgICAgICAgICAgICAgIGFwcl90YWJsZV9z
ZXQoci0+aGVhZGVyc19vdXQsICJEYXRlIiwNCi0gICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBhcF9wcm94eV9kYXRlX2Nhbm9uKHAsIGJ1ZikpOw0K
LSAgICAgICAgICAgIH0NCi0gICAgICAgICAgICBpZiAoKGJ1ZiA9IGFwcl90
YWJsZV9nZXQoci0+aGVhZGVyc19vdXQsICJFeHBpcmVzIikpICE9IE5VTEwp
IHsNCi0gICAgICAgICAgICAgICAgYXByX3RhYmxlX3NldChyLT5oZWFkZXJz
X291dCwgIkV4cGlyZXMiLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIGFwX3Byb3h5X2RhdGVfY2Fub24ocCwgYnVmKSk7DQotICAgICAgICAg
ICAgfQ0KLSAgICAgICAgICAgIGlmICgoYnVmID0gYXByX3RhYmxlX2dldChy
LT5oZWFkZXJzX291dCwgIkxhc3QtTW9kaWZpZWQiKSkgIT0gTlVMTCkgew0K
LSAgICAgICAgICAgICAgICBhcHJfdGFibGVfc2V0KHItPmhlYWRlcnNfb3V0
LCAiTGFzdC1Nb2RpZmllZCIsDQotICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgYXBfcHJveHlfZGF0ZV9jYW5vbihwLCBidWYpKTsNCi0gICAgICAg
ICAgICB9DQotICAgICAgICB9DQotDQotICAgICAgICAvKiBtdW5nZSB0aGUg
TG9jYXRpb24gYW5kIFVSSSByZXNwb25zZSBoZWFkZXJzIGFjY29yZGluZyB0
bw0KLSAgICAgICAgICogUHJveHlQYXNzUmV2ZXJzZQ0KKyAgICAgICAgLyog
TW92ZWQgdGhlIGZpeHVwcyBvZiBEYXRlIGhlYWRlcnMgYW5kIHRob3NlIGFm
ZmVjdGVkIGJ5DQorICAgICAgICAgKiBQcm94eVBhc3NSZXZlcnNlL2V0YyBm
cm9tIGhlcmUgdG8gYXBfcHJveHlfcmVhZF9oZWFkZXJzDQogICAgICAgICAg
Ki8NCi0gICAgICAgIHsNCi0gICAgICAgICAgICBjb25zdCBjaGFyICpidWY7
DQotICAgICAgICAgICAgaWYgKChidWYgPSBhcHJfdGFibGVfZ2V0KHItPmhl
YWRlcnNfb3V0LCAiTG9jYXRpb24iKSkgIT0gTlVMTCkgew0KLSAgICAgICAg
ICAgICAgICBhcHJfdGFibGVfc2V0KHItPmhlYWRlcnNfb3V0LCAiTG9jYXRp
b24iLA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwX3Byb3h5
X2xvY2F0aW9uX3JldmVyc2VfbWFwKHIsIGNvbmYsIGJ1ZikpOw0KLSAgICAg
ICAgICAgIH0NCi0gICAgICAgICAgICBpZiAoKGJ1ZiA9IGFwcl90YWJsZV9n
ZXQoci0+aGVhZGVyc19vdXQsICJDb250ZW50LUxvY2F0aW9uIikpICE9IE5V
TEwpIHsNCi0gICAgICAgICAgICAgICAgYXByX3RhYm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06.2004 17:06:30 von Graham Leggett

Nick Kew wrote:

> (2) Bug #29554 - URL munging
>
> I've ported Francois-Rene Rideau's patch to 2.1, subject to the
> question over proxy_fixup discussed in my last post.

Looking at this issue, I think the real solution is to

a) canonicalise all URLS (reverse and forward) for internal Apache use.
b) use the original untouched URL to pass to the backend.

I am uncomfortable with the distinction between forward and reverse
proxy - I think this patch might fix this bug for the forward case, but
not for the reverse case, which doesn't ultimately fix the problem.

> Any problems with committing this?

If it's possible to separate the patch out into two different patches -
one for each bug, it will make things easier to review.

The cookie issue has been around for a while, it would be good to see a
patch in v2.1 (and ultimately v2.0) - I don't want to see it held up by
the canonicalisation issue.

Regards,
Graham
--