tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Form Authentication POST data not preserved?
Date Sun, 05 Feb 2012 17:15:22 GMT
2012/2/5 Jess Holle <jessh@ptc.com>:
> On 2/5/2012 9:43 AM, Jess Holle wrote:
>>
>> On 2/5/2012 9:26 AM, Konstantin Kolinko wrote:
>>>
>>> build.xml:
>>> <javac srcdir="java" destdir="${tomcat.classes}"
>>>            debug="${compile.debug}"
>>>            deprecation="${compile.deprecation}"
>>>            source="${compile.source}"
>>>            target="${compile.target}"
>>>            optimize="${compile.optimize}"
>>>            excludes="**/.svn/**"
>>>            encoding="ISO-8859-1"
>>>            includeAntRuntime="true">
>>>
>>> build.properties.default:
>>> compile.debug=true
>>>
>>> Thus debug information should already be there.
>>>
>>> I usually start with setting some breakpoints. In your case take a
>>> look at FormAuthenticator#saveRequest() and #restoreRequest() methods
>>> and where they are called from.
>>
>> Thanks.  I've already seen via a heap dump that the request is saved with
>> the correct content body.  So now the only question that remains is why it
>> does not get restored.
>
>
> Diving in deeper, I see that AbstractAjpProcessor.action() is setting the
> bodyBytes perfectly for the ActionCode.REQ_SET_BODY_REPLAY case here.
>
> After that is done, however, I don't see anything that tries to read
> AbstractAjpProcessor.bodyBytes.
>  org.apache.catalina.connector.Request.readPostBody() seems to completely
> ignore this data.
>
> I'm thinking some refactoring in this area completely broke this use case at
> least for the AJP BIO path.  Or can someone offer evidence that the breakage
> is less general than this?
>

I think this issue is specific to AJP.

For HTTP connectors a similar issue was noted and fixed here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=51940#c9

I think adding the following line to "REQ_SET_BODY_REPLAY" case in
AbstractAjpProcessor#action() will fix this bug:

   endOfStream = false;


Best regards,
Konstantin Kolinko

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


Mime
View raw message