You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by na...@locus.apache.org on 2000/09/22 22:31:46 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util MimeHeaders.java
nacho 00/09/22 13:31:45
Modified: src/share/org/apache/tomcat/modules/server
Ajp12Interceptor.java
src/share/org/apache/tomcat/request AccessInterceptor.java
JDBCRealm.java SimpleMapper1.java
src/share/org/apache/tomcat/service/http
HttpRequestAdapter.java
src/share/org/apache/tomcat/util MimeHeaders.java
Log:
Some forgets of the latest refactoring done.
Revision Changes Path
1.2 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12Interceptor.java
Index: Ajp12Interceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12Interceptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Ajp12Interceptor.java 2000/09/19 07:02:24 1.1
+++ Ajp12Interceptor.java 2000/09/22 20:31:37 1.2
@@ -183,7 +183,7 @@
// Ajp use Status: instead of Status
class AJP12Response extends Response {
- HTTP http=new HTTP();
+ Http10 http=new Http10();
public void setSocket( Socket s ) throws IOException {
http.setSocket( s );
1.18 +2 -1 jakarta-tomcat/src/share/org/apache/tomcat/request/AccessInterceptor.java
Index: AccessInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/AccessInterceptor.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- AccessInterceptor.java 2000/08/11 06:14:11 1.17
+++ AccessInterceptor.java 2000/09/22 20:31:39 1.18
@@ -61,6 +61,7 @@
package org.apache.tomcat.request;
import org.apache.tomcat.core.*;
+import org.apache.tomcat.helper.*;
import org.apache.tomcat.core.Constants;
import org.apache.tomcat.util.*;
import javax.servlet.*;
@@ -240,7 +241,7 @@
getNote( secMapNote );
if( ctxSec.patterns==0 ) return 0; // fast exit
- String reqURI = req.getRequestURI();
+ String reqURI = RequestUtil.URLDecode(req.getRequestURI());
String ctxPath= ctx.getPath();
String path=reqURI.substring( ctxPath.length());
String method=req.getMethod();
1.20 +7 -4 jakarta-tomcat/src/share/org/apache/tomcat/request/JDBCRealm.java
Index: JDBCRealm.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/JDBCRealm.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- JDBCRealm.java 2000/09/01 04:46:14 1.19
+++ JDBCRealm.java 2000/09/22 20:31:40 1.20
@@ -1,4 +1,7 @@
-/*
+/*
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/JDBCRealm.java,v 1.20 2000/09/22 20:31:40 nacho Exp $
+ * $Revision: 1.20 $
+ * $Date: 2000/09/22 20:31:40 $
*
* The Apache Software License, Version 1.1
*
@@ -578,7 +581,7 @@
// XXX check transport
}
/**
- * Digestedentials (password) using MD5 and
+ * Digest password using the algorithm especificied and
* convert the result to a corresponding hex string.
* If exception, the plain credentials string is returned
*
@@ -588,7 +591,7 @@
* @param algorithm Algorithm used to do th digest
*
*/
- final private static String Digest(String credentials,String algorithm) {
+ final public static String Digest(String credentials,String algorithm) {
try {
// Obtain a new message digest with MD5 encryption
MessageDigest md = (MessageDigest)MessageDigest.getInstance(algorithm).clone();
@@ -606,7 +609,7 @@
return credentials;
}
}
-
+
public static void main(String args[] ) {
if (args.length >= 2) {
if( args[0].equalsIgnoreCase("-a")){
1.20 +13 -7 jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java
Index: SimpleMapper1.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- SimpleMapper1.java 2000/08/25 17:52:18 1.19
+++ SimpleMapper1.java 2000/09/22 20:31:41 1.20
@@ -61,6 +61,7 @@
package org.apache.tomcat.request;
import org.apache.tomcat.core.*;
+import org.apache.tomcat.helper.*;
import org.apache.tomcat.core.Constants;
import org.apache.tomcat.util.*;
import org.apache.tomcat.logging.*;
@@ -253,15 +254,19 @@
throw new RuntimeException("ASSERT: null path in request URI");
if( path.indexOf("?") >=0 )
throw new RuntimeException("ASSERT: ? in requestURI");
-
+
+ if ((path.indexOf('%') >= 0) || (path.indexOf('+') >= 0)) {
+ // XXX rewrite URLDecode to avoid allocation
+ path = RequestUtil.URLDecode(path);
+ }
try {
String host=null;
// MimeHeaders headers=req.getMimeHeaders();
// MimeHeaderField hostH=headers.find("host");
-
+
host=req.getServerName();
-
+
// if( hostH==null ) host=req.getLocalHost();
// if(hostH==null) host="localhost";
@@ -370,7 +375,7 @@
SimpleHashtable extM=(SimpleHashtable)ctx.
getContainer().getNote( ctExtMapNote );
if( extM==null ) return null;
-
+
// Find the container associated with that extension
Container container= (Container)extM.get(extension);
@@ -387,17 +392,18 @@
/** Adjust the paths in request after matching a container
*/
- void fixRequestPaths( String path, Request req, Container container ) {
+ void fixRequestPaths( String path, Request req, Container container ) throws Exception{
// Set servlet path and path info
// Found a match !
- // Adjust paths based on the match
+ // Adjust paths based on the match
String s=container.getPath();
String ctxP=container.getContext().getPath();
int sLen=s.length();
int pathLen=path.length();
int ctxPLen=ctxP.length();
String pathI=null;
-
+ // Perform URL decoding only if necessary
+
switch( container.getMapType()) {
case Container.PREFIX_MAP:
s=s.substring( 0, sLen -2 );
1.29 +3 -15 jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java
Index: HttpRequestAdapter.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- HttpRequestAdapter.java 2000/08/29 03:44:29 1.28
+++ HttpRequestAdapter.java 2000/09/22 20:31:42 1.29
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v 1.28 2000/08/29 03:44:29 costin Exp $
- * $Revision: 1.28 $
- * $Date: 2000/08/29 03:44:29 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v 1.29 2000/09/22 20:31:42 nacho Exp $
+ * $Revision: 1.29 $
+ * $Date: 2000/09/22 20:31:42 $
*
* ====================================================================
*
@@ -427,18 +427,6 @@
requestURI=uriMB.toString();
queryString=queryMB.toString();
- // Perform URL decoding only if necessary
- if ((uriMB.indexOf('%') >= 0) || (uriMB.indexOf('+') >= 0)) {
-
- try {
- // XXX rewrite URLDecode to avoid allocation
- requestURI = uriMB.toString();
- requestURI = RequestUtil.URLDecode(requestURI);
- } catch (Exception e) {
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- return;
- }
- }
// loghelper.log("XXX " + method + " " + requestURI + " " + queryString + " " + protocol );
1.15 +3 -0 jakarta-tomcat/src/share/org/apache/tomcat/util/MimeHeaders.java
Index: MimeHeaders.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/MimeHeaders.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- MimeHeaders.java 2000/08/31 18:01:30 1.14
+++ MimeHeaders.java 2000/09/22 20:31:43 1.15
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/MimeHeaders.java,v 1.15 2000/09/22 20:31:43 nacho Exp $
+ * $Revision: 1.15 $
+ * $Date: 2000/09/22 20:31:43 $
* ====================================================================
*
* The Apache Software License, Version 1.1