You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@locus.apache.org on 2000/12/02 04:52:57 UTC
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpRequestImpl.java HttpRequestStream.java
remm 00/12/01 19:52:57
Modified: catalina/src/share/org/apache/catalina/connector
RequestBase.java
catalina/src/share/org/apache/catalina/connector/http
HttpRequestImpl.java HttpRequestStream.java
Log:
- Will only attempt to consume leftover bytes if the request was an HTTP/1.1
request.
Revision Changes Path
1.8 +4 -9 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java
Index: RequestBase.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RequestBase.java 2000/11/17 02:58:59 1.7
+++ RequestBase.java 2000/12/02 03:52:55 1.8
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v 1.7 2000/11/17 02:58:59 remm Exp $
- * $Revision: 1.7 $
- * $Date: 2000/11/17 02:58:59 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v 1.8 2000/12/02 03:52:55 remm Exp $
+ * $Revision: 1.8 $
+ * $Date: 2000/12/02 03:52:55 $
*
* ====================================================================
*
@@ -97,7 +97,7 @@
* the connector-specific methods need to be implemented.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.7 $ $Date: 2000/11/17 02:58:59 $
+ * @version $Revision: 1.8 $ $Date: 2000/12/02 03:52:55 $
*/
public abstract class RequestBase
@@ -482,11 +482,6 @@
* @exception IOException if an input/output error occurs
*/
public void finishRequest() throws IOException {
-
- // If neither a reader or an is have been opened, do it to consume
- // request bytes, if any
- if ((reader == null) && (stream == null) && (getContentLength() != 0))
- getInputStream();
// If a Reader has been acquired, close it
if (reader != null) {
1.4 +23 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java
Index: HttpRequestImpl.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HttpRequestImpl.java 2000/11/24 19:55:20 1.3
+++ HttpRequestImpl.java 2000/12/02 03:52:56 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v 1.3 2000/11/24 19:55:20 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2000/11/24 19:55:20 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestImpl.java,v 1.4 2000/12/02 03:52:56 remm Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/12/02 03:52:56 $
*
* ====================================================================
*
@@ -79,7 +79,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.3 $ $Date: 2000/11/24 19:55:20 $
+ * @version $Revision: 1.4 $ $Date: 2000/12/02 03:52:56 $
*/
final class HttpRequestImpl
@@ -286,6 +286,25 @@
return headerPool[i];
}
return null;
+
+ }
+
+
+ /**
+ * Perform whatever actions are required to flush and close the input
+ * stream or reader, in a single operation.
+ *
+ * @exception IOException if an input/output error occurs
+ */
+ public void finishRequest() throws IOException {
+
+ // If neither a reader or an is have been opened, do it to consume
+ // request bytes, if any
+ if ((reader == null) && (stream == null) && (getContentLength() != 0)
+ && (getProtocol().equals("HTTP/1.1")))
+ getInputStream();
+
+ super.finishRequest();
}
1.3 +15 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java
Index: HttpRequestStream.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HttpRequestStream.java 2000/10/10 17:09:25 1.2
+++ HttpRequestStream.java 2000/12/02 03:52:56 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v 1.2 2000/10/10 17:09:25 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/10/10 17:09:25 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v 1.3 2000/12/02 03:52:56 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/12/02 03:52:56 $
*
* ====================================================================
*
@@ -99,6 +99,10 @@
response.addHeader("Connection", "close");
}
+ http11 = request.getProtocol().equals("HTTP/1.1");
+
+ System.out.println("HTTP/1.1: " + http11);
+
}
@@ -135,6 +139,12 @@
protected int chunkPos = 0;
+ /**
+ * HTTP/1.1 flag.
+ */
+ protected boolean http11 = false;
+
+
// --------------------------------------------------------- Public Methods
@@ -160,8 +170,9 @@
} else {
- if (length > 0) {
+ if (http11 && (length > 0)) {
while (count < length) {
+ System.out.println("Consuming bytes");
int b = read();
if (b < 0)
break;
Re: [BUG TRACKING] change to jakarta.apache.org
Posted by Nick Bauman <ni...@cortexity.com>.
On Sat, 2 Dec 2000, Craig R. McClanahan wrote:
> Fixed. I added the slash on the link for the viewer as well, and it seems to
> work OK.
Cool
> Craig
>
> PS: You might want to upgrade Tomcat to at least 3.2 :-)
That's what I did: that's what got the whole mess started! BugRat is
running with TC 3.2. I tried running it with 4.0 M4 but I lost confidence
somewhere down the line and gave up and went back to 3.2.
-Nick
Re: [BUG TRACKING] change to jakarta.apache.org
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Fixed. I added the slash on the link for the viewer as well, and it seems to
work OK.
Craig
PS: You might want to upgrade Tomcat to at least 3.2 :-)
Nick Bauman wrote:
> Sorry, I just noticed this.
>
> The link to BugRat in Jakarta needs a trailing slash.
>
> ie:
>
> http://znutar.cortexity.com/BugRatReport
>
> s/b
>
> http://znutar.cortexity.com/BugRatReport/
>
> As I was unable to correct the mappings from apache into tomcat. For some
> reason no matter what I do, tomcat loses track of the request if it
> doesn't have a trailing slash.
>
> Thanks!
Re: [BUG TRACKING] change to jakarta.apache.org
Posted by Jon Stevens <jo...@latchkey.com>.
on 12/2/2000 10:06 AM, "Nick Bauman" <ni...@cortexity.com> wrote:
> Or my own stupidity. But you my be right. I've been a friend of Apache
> since 0.9 days and I tried everything. When the request without the
> trailing slash arrives at Tomcat, tomcat thinks it's received a request
> for "", ie, nothing, according to the logs. I add the trailing slash and
> presto, everything is as it should be.
You do know about trailing slashes and how they are supposed to be handled,
correct?
URI's without a trailing slash are essentially invalid (ie: does it point to
a file or a directory or a resource?) and the server is supposed to issue a
http redirect for the same url but with the trailing slash in order to
resolve the issue if it points to a directory in order to deal with relative
paths to things. It is a long and very complicated issue.
It sounds like the connector you are using for Tomcat isn't dealing with
that issue properly.
thanks,
-jon
--
Honk if you love peace and quiet.
Re: [BUG TRACKING] change to jakarta.apache.org
Posted by Nick Bauman <ni...@cortexity.com>.
On Fri, 1 Dec 2000, Jon Stevens wrote:
> > http://znutar.cortexity.com/BugRatReport
> >
> > s/b
> >
> > http://znutar.cortexity.com/BugRatReport/
> >
> > As I was unable to correct the mappings from apache into tomcat. For some
> > reason no matter what I do, tomcat loses track of the request if it
> > doesn't have a trailing slash.
> >
> > Thanks!
>
> Sounds like a bug in the connector that should be fixed. :-)
>
> -jon
Or my own stupidity. But you my be right. I've been a friend of Apache
since 0.9 days and I tried everything. When the request without the
trailing slash arrives at Tomcat, tomcat thinks it's received a request
for "", ie, nothing, according to the logs. I add the trailing slash and
presto, everything is as it should be.
--
Nicolaus Bauman
Software Engineer
Simplexity Systems
Re: [BUG TRACKING] change to jakarta.apache.org
Posted by Jon Stevens <jo...@latchkey.com>.
on 12/1/2000 8:12 PM, "Nick Bauman" <ni...@cortexity.com> wrote:
> Sorry, I just noticed this.
>
> The link to BugRat in Jakarta needs a trailing slash.
>
> ie:
>
> http://znutar.cortexity.com/BugRatReport
>
> s/b
>
> http://znutar.cortexity.com/BugRatReport/
>
> As I was unable to correct the mappings from apache into tomcat. For some
> reason no matter what I do, tomcat loses track of the request if it
> doesn't have a trailing slash.
>
> Thanks!
Sounds like a bug in the connector that should be fixed. :-)
-jon
--
Honk if you love peace and quiet.
[BUG TRACKING] change to jakarta.apache.org
Posted by Nick Bauman <ni...@cortexity.com>.
Sorry, I just noticed this.
The link to BugRat in Jakarta needs a trailing slash.
ie:
http://znutar.cortexity.com/BugRatReport
s/b
http://znutar.cortexity.com/BugRatReport/
As I was unable to correct the mappings from apache into tomcat. For some
reason no matter what I do, tomcat loses track of the request if it
doesn't have a trailing slash.
Thanks!