[PATCH] mod_proxy handling of chunked requests

[PATCH] mod_proxy handling of chunked requests

am 11.03.2003 15:13:55 von Mathias Herberts

This is a cryptographically signed message in MIME format.

--------------ms090303050900090200090901
Content-Type: multipart/mixed;
boundary="------------010006030903070703030508"

This is a multi-part message in MIME format.
--------------010006030903070703030508
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Here is my second shot of a patch solving the issue of requests sent
using 'Transfer-Encoding: chunked' and handled by mod_proxy in Apache
1.3.27. Basically it changes mod_proxy behavior from
REQUEST_CHUNKED_ERROR to REQUEST_CHUNKED_PASS, meaning requests sent
using chunked transfer encoding will be passed as is to the origin server.

This patch is minimal and does not modify the behavior of mod_proxy for
non chunked requests, it issues an additional 'Transfer-Encoding:
chunked' when the request used one.

Please provide any feedback.

Mathias.

--
-- Informatique du Credit Mutuel ---- Reseaux et Systemes Distribues
-- 32 rue Mirabeau -- Le Relecq-Kerhuon -- 29808 Brest Cedex 9, FRANCE
-- Tel +33298004653 - Fax +33298284005 - Mail Mathias.Herberts@gicm.fr
-- Key Fingerprint: 8778 D2FD 3B4A 6B33 10AB F503 63D0 ADAE 9112 03E4

--------------010006030903070703030508
Content-Type: text/plain;
name="GICMApache-mod_proxy-chunked-requests.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="GICMApache-mod_proxy-chunked-requests.patch"

LS0tIGFwYWNoZV8xLjMuMjcvc3JjL21vZHVsZXMvcHJveHkvcHJveHlfaHR0 cC5jLm9yaWcJ
TW9uIE1hciAxMCAxNTozNjo0MyAyMDAzCisrKyBhcGFjaGVfMS4zLjI3L3Ny Yy9tb2R1bGVz
L3Byb3h5L3Byb3h5X2h0dHAuYwlUdWUgTWFyIDExIDEwOjU2OjEzIDIwMDMK QEAgLTQwNCw2
ICs0MDQsMTQgQEAKICAgICAgICAgYXBfYnZwdXRzKGYsIHJlcWhkcnNfZWx0 c1tpXS5rZXks
ICI6ICIsIHJlcWhkcnNfZWx0c1tpXS52YWwsIENSTEYsIE5VTEwpOwogICAg IH0KIAorICAg
IC8qCisgICAgICogT3V0cHV0IGEgVHJhbnNmZXItRW5jb2Rpbmc6IGNodW5r ZWQgaGVhZGVy
IGlmIHJlcXVlc3QgdXNlZCBpdC4KKyAgICAgKi8KKworICAgIGlmIChyLT5y ZWFkX2NodW5r
ZWQpIHsKKyAgICAgIGFwX2J2cHV0cyhmLCAiVHJhbnNmZXItRW5jb2Rpbmc6 IGNodW5rZWQi
LCBDUkxGLCBOVUxMKTsKKyAgICB9CisKICAgICAvKiB0aGUgb2JsaWdhdG9y eSBlbXB0eSBs
aW5lIHRvIG1hcmsgdGhlIGVuZCBvZiB0aGUgaGVhZGVycyAqLwogICAgIGFw X2JwdXRzKENS
TEYsIGYpOwogCi0tLSBhcGFjaGVfMS4zLjI3L3NyYy9tb2R1bGVzL3Byb3h5 L21vZF9wcm94
eS5jLm9yaWcJTW9uIE1hciAxMCAxNTozNjo0OCAyMDAzCisrKyBhcGFjaGVf MS4zLjI3L3Ny
Yy9tb2R1bGVzL3Byb3h5L21vZF9wcm94eS5jCU1vbiBNYXIgMTAgMTU6Mzk6 MTYgMjAwMwpA
QCAtMzE5LDcgKzMxOSw3IEBACiAgICAgICAgICAgICAgICAgYXBfcHNwcmlu dGYoci0+cG9v
bCwgIiVsZCIsIChtYXhmd2QgPiAwKSA/IG1heGZ3ZCAtIDEgOiAwKSk7CiAg ICAgfQogCi0g
ICAgaWYgKChyYyA9IGFwX3NldHVwX2NsaWVudF9ibG9jayhyLCBSRVFVRVNU X0NIVU5LRURf
RVJST1IpKSkKKyAgICBpZiAoKHJjID0gYXBfc2V0dXBfY2xpZW50X2Jsb2Nr KHIsIFJFUVVF
U1RfQ0hVTktFRF9QQVNTKSkpCiAgICAgICAgIHJldHVybiByYzsKIAogICAg IHVybCA9IHIt
PmZpbGVuYW1lICsgNjsK
--------------010006030903070703030508--

--------------ms090303050900090200090901
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH AQAAoIIJ5DCC
AzgwggKhoAMCAQICEGZFcrfMdPXPY3ZFhNAukQEwDQYJKoZIhvcNAQEEBQAw gdExCzAJBgNV
BAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUg VG93bjEaMBgG
A1UEChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRp b24gU2Vydmlj
ZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFp bCBDQTErMCkG
CSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxAdGhhd3RlLmNvbTAeFw0w MDA4MzAwMDAw
MDBaFw0wNDA4MjcyMzU5NTlaMIGSMQswCQYDVQQGEwJaQTEVMBMGA1UECBMM V2VzdGVybiBD
YXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xDzANBgNVBAoTBlRoYXd0ZTEdMBsG A1UECxMUQ2Vy
dGlmaWNhdGUgU2VydmljZXMxKDAmBgNVBAMTH1BlcnNvbmFsIEZyZWVtYWls IFJTQSAyMDAw
LjguMzAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAN4zMqZjxwklRT7S bngnZ4HF2ogZ
gpcO40QpimM1Km1wPPrcrvfudG8wvDOQf/k0caCjbZjxw0+iZdsN+kvx1t1h pfmFzVWaNRqd
knWoJ67Ycvm6AvbXsJHeHOmr4BgDqHxDQlBRh4M88Dm0m1SKE4f/s5udSWYA LQmJ7JRr6aFp
AgMBAAGjTjBMMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFQcml2YXRlTGFi ZWwxLTI5NzAS
BgNVHRMBAf8ECDAGAQH/AgEAMAsGA1UdDwQEAwIBBjANBgkqhki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IFJTQSAyMDAwLjguMzACAwhKdzCBrQYL KoZIhvcNAQkQ
AgsxgZ2ggZowgZIxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENh cGUxEjAQBgNV
BAcTCUNhcGUgVG93bjEPMA0GA1UEChMGVGhhd3RlMR0wGwYDVQQLExRDZXJ0 aWZpY2F0ZSBT
ZXJ2aWNlczEoMCYGA1UEAxMfUGVyc29uYWwgRnJlZW1haWwgUlNBIDIwMDAu OC4zMAIDCEp3
MA0GCSqGSIb3DQEBAQUABIIBAAWanEBBdEbWYX1FrlrsQBNVARRJ9EbA39UX 4PzY6jnKucKS
SzwLk9Td2O1/BFcgyHD84eIAeX41bo5/wywAK0kCwqt9RkJ5EdnfHdTFMnDB vPUdWdsSzJUS
0IP0CO0ZkYAQWv2ODt+6c7DmWvyXwnPNIwOt+Y42H8VfIuZFca/tSnDWNxSD WpQIrR06iT7+
myNann0mb6r0UbZtK4fQyUq6Jxx78DKGKpHNJgkX/4N8RgXKqd45osGr4jpo Em05Ss+xoD1e
FaHCUbM6lgIwRIYW9N2sXYPq9iVGyTVM9UEKz2N9aengxujmk5vQaIpi0+Wk 0NrqTKmNq5tr
HkysMNUAAAAAAAA=
--------------ms090303050900090200090901--

Re: [PATCH] mod_proxy handling of chunked requests

am 15.03.2003 07:06:35 von Alex Rousskov

Mathias,

We have not tested Apache 1.3.27, but recent 2.x versions seem
to pass all our test cases related to chunked requests in a forward
proxy environment. If you can upgrade, it may solve your problem (but
may trigger other bugs).

I am sorry that I cannot help you directly, but I am excited
to see another real-world use of chunked requests. We have been
working with many HTTP implementations that cannot handle those, and
it always helps to have more real-world demand when you argue for
HTTP/1.1 compliance. I am not an Apache developer, but if you think
that testing your patch will help its inclusion in 1.x code branch,
please contact me to arrange for a free test.

Good luck,

Alex.

--
| HTTP performance - Web Polygraph benchmark
www.measurement-factory.com | HTTP compliance+ - Co-Advisor test suite
| all of the above - PolyBox appliance

On Tue, 11 Mar 2003, Mathias Herberts wrote:

> Here is my second shot of a patch solving the issue of requests sent
> using 'Transfer-Encoding: chunked' and handled by mod_proxy in Apache
> 1.3.27. Basically it changes mod_proxy behavior from
> REQUEST_CHUNKED_ERROR to REQUEST_CHUNKED_PASS, meaning requests sent
> using chunked transfer encoding will be passed as is to the origin server.
>
> This patch is minimal and does not modify the behavior of mod_proxy for
> non chunked requests, it issues an additional 'Transfer-Encoding:
> chunked' when the request used one.
>
> Please provide any feedback.
>
> Mathias.
>
> --
> -- Informatique du Credit Mutuel ---- Reseaux et Systemes Distribues
> -- 32 rue Mirabeau -- Le Relecq-Kerhuon -- 29808 Brest Cedex 9, FRANCE
> -- Tel +33298004653 - Fax +33298284005 - Mail Mathias.Herberts@gicm.fr
> -- Key Fingerprint: 8778 D2FD 3B4A 6B33 10AB F503 63D0 ADAE 9112 03E4
>