From 4845cdba999fe7da071f40c4fff484fa7198e82b Mon Sep 17 00:00:00 2001 From: jfclere Date: Sat, 27 Oct 2007 08:25:56 +0000 Subject: [PATCH] Commit the accepted proposal to prevent CLOSE_WAIT sockets. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@589062 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 4 ---- java/org/apache/coyote/ajp/AjpProcessor.java | 4 +--- java/org/apache/coyote/ajp/AjpProtocol.java | 3 ++- webapps/docs/changelog.xml | 3 +++ 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/STATUS b/STATUS index 598d62bbe..0c9fed5ff 100644 --- a/STATUS +++ b/STATUS @@ -26,10 +26,6 @@ PATCHES PROPOSED TO BACKPORT: [ New proposals should be added at the end of the list ] -* Harmonize with HTTP java.io code. Otherwise the socket is not closed. http://people.apache.org/~jfclere/patches/AjpPro.patch - +1: jfclere, fhanik, remm, pero, jim - -1: - * Fix BZ 43588 - hard coded 127.0.0.1 for localhost http://issues.apache.org/bugzilla/attachment.cgi?id=21039&action=view +1: diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index 5dfe0474d..fe4e17cfd 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -355,7 +355,7 @@ public class AjpProcessor implements ActionHook { * * @throws IOException error during an I/O operation */ - public boolean process(Socket socket) + public void process(Socket socket) throws IOException { RequestInfo rp = request.getRequestProcessor(); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); @@ -471,8 +471,6 @@ public class AjpProcessor implements ActionHook { input = null; output = null; - return true; - } diff --git a/java/org/apache/coyote/ajp/AjpProtocol.java b/java/org/apache/coyote/ajp/AjpProtocol.java index 6b129c7b0..d54885f89 100644 --- a/java/org/apache/coyote/ajp/AjpProtocol.java +++ b/java/org/apache/coyote/ajp/AjpProtocol.java @@ -363,7 +363,8 @@ public class AjpProtocol ((ActionHook) processor).action(ActionCode.ACTION_START, null); } - return processor.process(socket); + processor.process(socket); + return false; } catch(java.net.SocketException e) { // SocketExceptions are normal diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 6a8589ce6..5beda11cf 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -142,6 +142,9 @@ + Harmonize with HTTP java.io code. Otherwise the socket is not closed. + + In the APR connector, start accepting connections after fully starting the connector, to prevent possible exceptions due to non initialized fields. (remm) -- 2.11.0