tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 53411] NullPointerException in org.apache.tomcat.util.buf.CharChunk
Date Wed, 13 Jun 2012 21:55:10 GMT

Konstantin Kolinko <> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---
           Severity|normal                      |enhancement

--- Comment #5 from Konstantin Kolinko <> ---
Reopening this as enhancement.

Looking at AbstractHttp11Processor#process() this error is correctly written to
access log, etc, so I do not see much concern.

Still I think there is a room for improvement, and I noted several minor issues
from my code review.

1) in MapperListener#findDefaultHost()

First, maybe 

Second, maybe mention something like " Tomcat will not be able to process
HTTP/1.0 requests that do not specify a Host header" in the message.

Third, I am a bit wondering why not to call mapper.setDefaultHost()
unconditionally. What is wrong with passing a name there?

Hosts can be added and removed through JMX calls on
StandardEngine#addChild()/removeChild() and it seems that MapperListener fails
to update defaultHost setting on the Mapper when it happens.

So why not to pass the defaultHost name to the Mapper as is and let it handle
missing matches (like it already does)?

2) in Mapper#map(MB,MB,S,MD)

Maybe just return without mapping here, as if the Host is not found. We already
do if(defaultHostName==null){ return; } in its #internalMap(CC,CC,S,MD) method.

It will need some update to its caller though, which is

3) In CoyoteAdapter#postParseRequest()

This request could be rejected with error 404, instead of 400 that exception
handling in AbstractHttp11Processor#process() does. The postParseRequest()
already has code for handling it as 404, but

access logging needs to be changed a bit. The current code:

                // Make sure there is a host (might not be during shutdown)
                if (host != null) {
                    host.logAccess(request, response, 0, true);

I think that it should fallback to CoyoteAdapter#log(..) when host is null.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message