You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/10/14 23:31:05 UTC

DO NOT REPLY [Bug 31722] New: - In JNI mode, POST is broken due to bodyMsg.getLen() == 0 not working properly

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=31722>.
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=31722

In JNI mode, POST is broken due to bodyMsg.getLen() == 0 not working properly

           Summary: In JNI mode, POST is broken due to bodyMsg.getLen() == 0
                    not working properly
           Product: Tomcat 5
           Version: 5.0.24
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Connector:AJP
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: suhtim@aol.com


Subject: Re: if( bodyMsg.getLen() <= 4 )
Date: 10/14/04, 4:19 PM
From: Kurt Miller <tr...@apache.org>
To: Tim Suh

Hi Tim,

From: Tim Suh
> JkInputStream.java contains
>
> if( bodyMsg.getLen() <= 4 )
>
> which was fixed to
>
> if( bodyMsg.getLen() == 0 )
>
> but isn't this incorrect ? MsgAjp.java reset() contains len = 4.
> How can getLen() ever become 0 ?

The line after reset calls receive:

       int err = mc.getSource().receive(bodyMsg, mc);

For sockets this calls ChannelSocket.receive and it calls
MsgAjp.processHeader() for bodyMsg. processHeader sets the
len to the length of the packet excluding the header. Unix Sockets
work the same way as ChannelSocket.

However, for jni this calls ChannelJni.receive and it does
not call MsgAjp.processHeader() for bodyMsg. len is
left a 4 and if( bodyMsg.getLen() == 0 ) doesn't detect
the fact it should return at the point.

> This is breaking jni POST by the way.

I see why now (see above). I'm thinking MsgAjp.reset should
set len = 0, but this needs a through review of all the uses of
MsgAjp to see the impact. An alternative solution would be
to add a method to MsgAjp that ChannelJni.receive could call
that sets len = 0.

> Not sure if you are monitoring this email address so my message
> above is very short. Let me know whether I need to report this to
> bugzilla. Thanks

Yes, please do open a bugzilla report and copy this full email into
it.

Thanks,
-Kurt

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org