remm 2003/08/20 10:31:37 Modified: util/java/org/apache/tomcat/util/http/mapper Mapper.java Log: - Optimization: If char to String already occurred due to the lookup in the dir context, set it as String in addition to doing the setChars (to avoid having to do it again later on). This helps a bit static file serving. Revision Changes Path 1.28 +15 -6 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java Index: Mapper.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- Mapper.java 7 Aug 2003 13:55:56 -0000 1.27 +++ Mapper.java 20 Aug 2003 17:31:37 -0000 1.28 @@ -699,21 +699,26 @@ if (mappingData.wrapper == null && context.resources != null) { Object file = null; + String pathStr = path.toString(); try { - file = context.resources.lookup(path.toString()); + file = context.resources.lookup(pathStr); } catch(NamingException nex) { // Swallow not found, since this is normal } if (file != null && !(file instanceof DirContext) ) { internalMapExtensionWrapper(extensionWrappers, path, mappingData); - if(mappingData.wrapper == null) { + if (mappingData.wrapper == null) { mappingData.wrapper = context.defaultWrapper.object; - mappingData.requestPath.setChars( - path.getBuffer(), path.getStart(), path.getLength()); + mappingData.requestPath.setChars + (path.getBuffer(), path.getStart(), + path.getLength()); mappingData.wrapperPath.setChars - (path.getBuffer(), path.getStart(), path.getLength()); + (path.getBuffer(), path.getStart(), + path.getLength()); + mappingData.requestPath.setString(pathStr); + mappingData.wrapperPath.setString(pathStr); } } } @@ -736,8 +741,9 @@ char[] buf = path.getBuffer(); if (context.resources != null && buf[pathEnd -1 ] != '/') { Object file = null; + String pathStr = path.toString(); try { - file = context.resources.lookup(path.toString()); + file = context.resources.lookup(pathStr); } catch(NamingException nex) { // Swallow, since someone else handles the 404 } @@ -749,6 +755,9 @@ path.append('/'); mappingData.redirectPath.setChars (path.getBuffer(), path.getStart(), path.getLength()); + } else { + mappingData.requestPath.setString(pathStr); + mappingData.wrapperPath.setString(pathStr); } } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]