This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: Fix HTTP posts
- From: Anthony Green <green at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Cc: Christophe Roux <ch_roux at club-internet dot fr>
- Date: 07 Sep 2002 12:55:58 -0700
- Subject: Patch: Fix HTTP posts
Another little fix from Christophe. Out HTTP Connection class was trying
to read HTTP headers even for output/POST connections. This just defers
reading headers 'til we know for sure that we're going to read from the
socket.
Ok for trunk and 3.2 branch?
AG
2002-09-07 Anthony Green <green@redhat.com>
* gnu/gcj/protocol/http/Connection.java: Don't try to read headers
when this is used as an output stream. From Christophe Roux.
(haveHeaders): Define new private boolean.
(connect): Don't read headers.
(getInputStream): Read headers.
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:52:08 -0000
*************** class Connection extends HttpURLConnecti
*** 40,43 ****
--- 40,44 ----
private Vector hdrVec = new Vector();
private BufferedInputStream bufferedIn;
+ private haveHeaders = false;
public Connection(URL url)
*************** class Connection extends HttpURLConnecti
*** 103,108 ****
out.print("\n");
out.flush();
- getHttpHeaders();
connected = true;
}
--- 104,109 ----
out.print("\n");
out.flush();
connected = true;
+ haveHeaders = false;
}
*************** class Connection extends HttpURLConnecti
*** 135,138 ****
--- 136,142 ----
if (!connected)
connect();
+
+ if (!haveHeaders)
+ getHttpHeaders();
if (!doInput)