https://issues.apache.org/bugzilla/show_bug.cgi?id=56692

--- Comment #8 from Daniel Qian <chanjars...@gmail.com> ---
Thanks for explan.

Does that mean that the request parameters never got the chance to be parsed,
so the Request in valve can not got the parameters ?

And I have another question: How can I set logger to DEBUG level when I run
Tomcat test case ? I'm writing a custom Valve, if you tell me it will be very
helpful. Thanks in advance.


(In reply to Konstantin Kolinko from comment #7)
> Technically, the following happens:
> 
> Debugging Bug56692.java (Attachment 31792 [details]) with the current Tomcat
> 8 trunk @1608001
> 
> (1) InputBuffer is marked as closed.
> Stack trace from debugger:
> 
>       InputBuffer.close() line: 232   
>       OutputBuffer.close() line: 300  
>       Response.finishResponse() line: 423     
>       CoyoteAdapter.service(Request, Response) line: 567      
> 
> (2) Reading request body fails with new
> IOException(sm.getString("inputBuffer.streamClosed"));
> Stack trace from debugger:
> 
>       InputBuffer.read(byte[], int, int) line: 360    
>       CoyoteInputStream.read(byte[], int, int) line: 190      
>       Request.readPostBody(byte[], int) line: 3035    
>       Request.parseParameters() line: 2984    
>       Request.getParameterNames() line: 1128  
>       Bug56692$BugValve.log(Request, Response, long) line: 65 
>       AccessLogAdapter.log(Request, Response, long) line: 51  
>       StandardHost(ContainerBase).logAccess(Request, Response, long, boolean)
> line: 1042    
>       StandardContext(ContainerBase).logAccess(Request, Response, long, 
> boolean)
> line: 1049    
>       CoyoteAdapter.service(Request, Response) line: 574      
> 
> So technically if one delays closing of InputBuffer into some separate
> method, then this behaviour might be possible.
> 
> Caveats:
> 1. Closing the InputBuffer is commented in OutputBuffer.close() as the way
> to prevent errors with AJP protocol (bug 50189)
> 
> 2. The time needed to parse the body won't be included into values of %D and
> %T (Time taken to process the request) that are already calculated when
> AccessLog.log() is invoked.
> 
> 3. ExtendedAccessLogValve has support for logging request parameters with
> "x-P(XXX)". It may be worth documenting its limitations. [1]
> 
> [1]
> http://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Access_Log_Valve

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to