Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BAA42973B for ; Wed, 13 Jun 2012 21:55:37 +0000 (UTC) Received: (qmail 50187 invoked by uid 500); 13 Jun 2012 21:55:37 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 50130 invoked by uid 500); 13 Jun 2012 21:55:36 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 50121 invoked by uid 99); 13 Jun 2012 21:55:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 21:55:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 21:55:33 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id 06E15566C; Wed, 13 Jun 2012 21:55:11 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 53411] NullPointerException in org.apache.tomcat.util.buf.CharChunk Date: Wed, 13 Jun 2012 21:55:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 7 X-Bugzilla-Component: Catalina X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: knst.kolinko@gmail.com X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: bug_status resolution bug_severity Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=53411 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 s/log.warn(sm.getString("mapperListener.unknownDefaultHost",/log.error/ 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) Fourth, 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 CoyoteAdapter#postParseRequest() 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 Fifth, 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: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org