You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@locus.apache.org on 2000/08/31 23:56:01 UTC
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpProcessor.java
craigmcc 00/08/31 14:56:01
Modified: catalina/src/share/org/apache/catalina/connector/http
HttpProcessor.java
Log:
Work around a problem with Java clients using the JDK 1.3 version of the
HttpURLConnection class (and probably other HTTP/1.1 clients as well).
The problem was that the client would send an HTTP/1.1 request, and include
the "Connection: keep-alive" header. Catalina's HTTP/1.1 connector would
therefore dutifully keep the connection open and listen for a subsequent
request, which would not happen if the client just closed the connection.
Now, the request processing code detects this situation and silently closes
the socket, instead of complaining about the lack of a request line.
Revision Changes Path
1.4 +9 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
Index: HttpProcessor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HttpProcessor.java 2000/08/24 23:56:58 1.3
+++ HttpProcessor.java 2000/08/31 21:56:00 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v 1.3 2000/08/24 23:56:58 craigmcc Exp $
- * $Revision: 1.3 $
- * $Date: 2000/08/24 23:56:58 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v 1.4 2000/08/31 21:56:00 craigmcc Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/08/31 21:56:00 $
*
* ====================================================================
*
@@ -66,6 +66,7 @@
import java.io.BufferedInputStream;
+import java.io.EOFException;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -106,7 +107,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.3 $ $Date: 2000/08/24 23:56:58 $
+ * @version $Revision: 1.4 $ $Date: 2000/08/31 21:56:00 $
*/
final class HttpProcessor
@@ -607,7 +608,7 @@
// Parse the incoming request line
String line = read(input);
if (line == null)
- throw new ServletException
+ throw new EOFException
(sm.getString("httpProcessor.parseRequest.read"));
parser.setString(line);
@@ -775,6 +776,9 @@
((HttpResponseImpl) response).setAllowChunking(true);
}
}
+ } catch (EOFException e) {
+ // log("process.parse: EOFException: " + e);
+ ok = false;
} catch (Exception e) {
try {
log("process.parse", e);