This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: HTTP/1.0 fix
- From: Anthony Green <green at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Cc: ch_roux at club-internet dot fr
- Date: 07 Sep 2002 12:25:42 -0700
- Subject: Patch: HTTP/1.0 fix
Christophe Roux found this bug, among others, while debugging some servlets.
Ok for trunk?
What it the policy for the 3.2 branch now? It would be nice to get this in
for other Tomcat users.
AG
2002-09-07 Anthony Green <green@redhat.com>
* gnu/gcj/protocol/http/Connection.java (connect): Replace \n with
\r\n. HTTP/1.0 defines the octet sequence CR LF as the
end-of-line marker for all protocol elements except the
Entity-Body. From Christophe Roux.
Index: libjava/gnu/gcj/protocol/http/Connection.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/protocol/http/Connection.java,v
retrieving revision 1.7
diff -2 -c -p -r1.7 Connection.java
*** libjava/gnu/gcj/protocol/http/Connection.java 23 Aug 2002 04:54:03 -0000 1.7
--- libjava/gnu/gcj/protocol/http/Connection.java 7 Sep 2002 19:20:36 -0000
*************** class Connection extends HttpURLConnecti
*** 95,105 ****
// Send request including any request properties that were set.
! out.print(getRequestMethod() + " " + url.getFile() + " HTTP/1.0\n");
! out.print("Host: " + url.getHost() + ":" + port + "\n");
Enumeration reqKeys = requestProperties.keys();
Enumeration reqVals = requestProperties.elements();
while (reqKeys.hasMoreElements())
! out.print(reqKeys.nextElement() + ": " + reqVals.nextElement() + "\n");
! out.print("\n");
out.flush();
getHttpHeaders();
--- 95,105 ----
// Send request including any request properties that were set.
! out.print(getRequestMethod() + " " + url.getFile() + " HTTP/1.0\r\n");
! out.print("Host: " + url.getHost() + ":" + port + "\r\n");
Enumeration reqKeys = requestProperties.keys();
Enumeration reqVals = requestProperties.elements();
while (reqKeys.hasMoreElements())
! out.print(reqKeys.nextElement() + ": " + reqVals.nextElement() + "\r\n");
! out.print("\r\n");
out.flush();
getHttpHeaders();