Fix that pattern with subtokens ended, are print out subtoken
authorpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 27 Mar 2007 10:10:45 +0000 (10:10 +0000)
committerpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 27 Mar 2007 10:10:45 +0000 (10:10 +0000)
Example cs(Host) date time cs-uri sc-status x-C(JSESSIONID) time-taken
prints  'localhost:30014' 2007-03-27 10:02:47 /test/ 200 '336C8E8300402846604650DFCE9A6059.tomcat6' 0.001taken
instead 'localhost:30014' 2007-03-27 10:02:47 /test/ 200 '336C8E8300402846604650DFCE9A6059.tomcat6' 0.001

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@522854 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/valves/ExtendedAccessLogValve.java

index 4fde981..858e9f8 100644 (file)
@@ -403,6 +403,9 @@ public class ExtendedAccessLogValve
         }
         
         public String getToken() throws IOException {
+            if(ended)
+                return null ;
+            
             String result = null;
             subToken = false;
             parameter = false;
@@ -462,6 +465,8 @@ public class ExtendedAccessLogValve
         }
         
         public String getWhiteSpaces() throws IOException {
+            if(isEnded())
+                return "" ;
             StringBuffer whiteSpaces = new StringBuffer();
             if (buf.length() > 0) {
                 whiteSpaces.append(buf);