This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: patch: gnu.java.net.protocol.http.Connection
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 31 Dec 2003 12:31:51 +0100
- Subject: FYI: patch: gnu.java.net.protocol.http.Connection
Hi list,
I commited the attached patch to merge a fix from classpath to encode the
output stream correctly and to put a meaningful htt user agent into the
stream.
Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2505
diff -u -b -B -r1.2505 ChangeLog
--- ChangeLog 31 Dec 2003 11:04:17 -0000 1.2505
+++ ChangeLog 31 Dec 2003 11:25:09 -0000
@@ -1,3 +1,9 @@
+2003-12-31 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (sendRequest): Dont encode output in default character encoding,
+ add correct version number to HTTP user agent string.
+
2003-12-31 Guilhem Lavaux <guilhem@kaffe.org>
* java/io/ObjectOutputStream.java
Index: gnu/java/net/protocol/http/Connection.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/net/protocol/http/Connection.java,v
retrieving revision 1.12
diff -u -b -B -r1.12 Connection.java
--- gnu/java/net/protocol/http/Connection.java 30 Dec 2003 13:43:24 -0000 1.12
+++ gnu/java/net/protocol/http/Connection.java 31 Dec 2003 11:25:09 -0000
@@ -45,6 +45,7 @@
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
@@ -200,7 +201,8 @@
void sendRequest() throws IOException
{
// Create PrintWriter for easier sending of headers.
- PrintWriter outputWriter = new PrintWriter(outputStream);
+ PrintWriter outputWriter =
+ new PrintWriter(new OutputStreamWriter(outputStream, "8859_1"));
// Send request including any request properties that were set.
outputWriter.print (getRequestMethod() + " " + url.getFile()
@@ -215,7 +217,7 @@
if (getRequestProperty ("user-agent") == null)
setRequestProperty ("user-agent", "gnu-libgcj/"
- + System.getProperty ("classpath.version"));
+ + System.getProperty ("java.vm.version"));
if (getRequestProperty ("accept") == null)
setRequestProperty ("accept", "*/*");