glenn 2002/12/30 08:00:32
Modified: jk/java/org/apache/ajp/tomcat4 Ajp13Processor.java
Log:
Fix bug 10383 and remove stack trace from client abort type of exception
Revision Changes Path
1.10 +24 -7
jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat4/Ajp13Processor.java
Index: Ajp13Processor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat4/Ajp13Processor.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Ajp13Processor.java 7 Jun 2002 18:54:21 -0000 1.9
+++ Ajp13Processor.java 30 Dec 2002 16:00:32 -0000 1.10
@@ -441,9 +441,15 @@
try {
// set flag
handlingRequest.set(true);
-
+
+ boolean bad_request = false;
+
// set up request
- request.setAjpRequest(ajpRequest);
+ try {
+ request.setAjpRequest(ajpRequest);
+ } catch (IllegalArgumentException e) {
+ bad_request = true;
+ }
request.setResponse(response);
request.setStream(input);
@@ -455,7 +461,11 @@
logger.log("invoking...");
}
- connector.getContainer().invoke(request, response);
+ if (!bad_request) {
+ connector.getContainer().invoke(request, response);
+ } else {
+ response.sendError(400);
+ }
if (debug > 0) {
logger.log("done invoking, finishing request/response....");
@@ -468,6 +478,13 @@
logger.log("finished handling request.");
}
+ } catch (IOException ioe) {
+ // Normally this catches a socket Broken Pipe caused by the
+ // remote client aborting the request. mod_jk will close the
+ // socket on its side and the processor will get a socket EOF
+ // when it next tries to read from mod_jk, then recycle itself
+ // normally. Don't print the stack trace in this case.
+ logger.log("process: IOException " + ioe.getMessage());
} catch (Throwable e) {
logger.log("process: invoke", e);
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>