Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 63420 invoked by uid 500); 11 Jul 2001 05:24:15 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 63409 invoked by uid 500); 11 Jul 2001 05:24:15 -0000 Delivered-To: apmail-jakarta-tomcat-cvs@apache.org Date: 11 Jul 2001 05:24:15 -0000 Message-ID: <20010711052415.63405.qmail@apache.org> From: larryi@apache.org To: jakarta-tomcat-cvs@apache.org Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java larryi 01/07/10 22:24:15 Modified: src/share/org/apache/tomcat/core Tag: tomcat_32 ContextManager.java Log: Prior patch to fix recursive status handling went too far and broke authorization which makes a recursive call to the status handling. Modify to report a recursive loop only if recursion occurs with the same status code. Suggested by: Ignacio J. Ortega Revision Changes Path No revision No revision 1.100.2.25 +5 -3 jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java Index: ContextManager.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v retrieving revision 1.100.2.24 retrieving revision 1.100.2.25 diff -u -r1.100.2.24 -r1.100.2.25 --- ContextManager.java 2001/07/06 18:40:05 1.100.2.24 +++ ContextManager.java 2001/07/11 05:24:14 1.100.2.25 @@ -1047,7 +1047,7 @@ if( debug>0 ) ctx.log( "Handler " + errorServlet + " " + errorPath); - if ( statusLoop( ctx, req ) ){ + if ( statusLoop( ctx, req, code ) ){ log( "Error loop for " + req + " error code " + code); return; } @@ -1206,8 +1206,10 @@ /** Handle the case of status handler generating an error */ - private boolean statusLoop( Context ctx, Request req ) { - if ( req.getAttribute("javax.servlet.error.status_code") != null ) { + private boolean statusLoop( Context ctx, Request req, int newCode ) { + Integer lastCode = (Integer)req.getAttribute("javax.servlet.error.status_code"); + // If status code repeated, assume recursive loop + if ( lastCode != null && lastCode.intValue() == newCode) { if( ctx.getDebug() > 0 ) ctx.log( "Error: nested error inside status servlet " + req.getAttribute("javax.servlet.error.status_code"));