You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GOMEZ Henri <hg...@slib.fr> on 2001/09/17 11:22:09 UTC
Ajp13 change in recent TC 3.3
Hi to all,
The works conducted on ajp13 in TC 3.3 to add chunk
support and better handling of the content-length,
have broken compatibility with previous mod_jk.
Now, from the java side, the content-length is mandatory
in stream, and if you try to use olders mod_jk
(ie from TC 3.2.3 or the one from JTC before I commit changes)
with recent TC 3.3, tomcat will wait infinitly the rest of data.
if content-length is not sent by mod_jk, contentLength = -1
and we'll try to get data in line 417 and will wait forever.
>From Ajp13 - Line 409 :
// Check to see if there should be a body packet coming along
// immediately after
MessageBytes clB=headers.getValue("content-length");
int contentLength = (clB==null) ? -1 : clB.getInt();
if( dL > 0 ) d("Content-Length: " + contentLength );
if(contentLength != 0) {
req.setContentLength( contentLength );
/* Read present data */
int err = receive(inBuf);
if(err < 0) {
return 500;
}
What about that patch which allways set ContentLength
but try to get others datas only in contentLength is set
and not -1 ....
--- Ajp13.java.orig Mon Sep 17 11:16:05 2001
+++ Ajp13.java Mon Sep 17 11:16:30 2001
@@ -411,8 +411,8 @@
MessageBytes clB=headers.getValue("content-length");
int contentLength = (clB==null) ? -1 : clB.getInt();
if( dL > 0 ) d("Content-Length: " + contentLength );
- if(contentLength != 0) {
- req.setContentLength( contentLength );
+ req.setContentLength( contentLength );
+ if(contentLength != 0 && contentLength != -1) {
/* Read present data */
int err = receive(inBuf);
if(err < 0) {
Here is the table of working mod_jk / ajp13
mod_jk Ajp13
TC 3.2 TC 3.2 OK
TC 3.2 TC 3.3 DON'T WORKS
TC 3.2 JTC WORKS
TC 3.3 TC 3.2 WORKS
TC 3.3 TC 3.3 WORKS
TC 3.3 JTC WORKS
JTC TC 3.2 WORKS
JTC TC 3.3 WORKS (since friday patches)
JTC JTC WORKS
-
Henri Gomez ___[_]____
EMAIL : hgomez@slib.fr (. .)
PGP KEY : 697ECEDD ...oOOo..(_)..oOOo...
PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6
RE: Ajp13 change in recent TC 3.3
Posted by Keith Wannamaker <Ke...@Wannamaker.org>.
| -----Original Message-----
| What about that patch which allways set ContentLength
| but try to get others datas only in contentLength is set
| and not -1 ....
|
|
| --- Ajp13.java.orig Mon Sep 17 11:16:05 2001
| +++ Ajp13.java Mon Sep 17 11:16:30 2001
| @@ -411,8 +411,8 @@
| MessageBytes clB=headers.getValue("content-length");
| int contentLength = (clB==null) ? -1 : clB.getInt();
| if( dL > 0 ) d("Content-Length: " + contentLength );
| - if(contentLength != 0) {
| - req.setContentLength( contentLength );
| + req.setContentLength( contentLength );
| + if(contentLength != 0 && contentLength != -1) {
| /* Read present data */
| int err = receive(inBuf);
| if(err < 0) {
CL=-1 means the request is chunked, and we must read until
we get an end of stream, so this patch would break that.
Definitely the changes require upgrading jk when Tomcat
is upgraded to 3.3.. there's no way around that.
Keith
Re: Ajp13 change in recent TC 3.3
Posted by cm...@yahoo.com.
On Mon, 17 Sep 2001, GOMEZ Henri wrote:
> Hi to all,
>
> The works conducted on ajp13 in TC 3.3 to add chunk
> support and better handling of the content-length,
> have broken compatibility with previous mod_jk.
I think the only compatibility that matters is 3.2.3
working with the new mod_jk.
We should recomend people to upgrade at least mod_jk to
3.3/jk or j-t-c/jk, there are many bug fixes they'll need.
Using the old jk with 3.3 is not a good idea.
Costin