[kaffe] CVS kaffe (dalibor): Resynced with GNU Classpath

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Mon Feb 2 09:29:03 2004


PatchSet 4388 
Date: 2004/02/02 17:25:21
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath

2004-02-02  Dalibor Topic <robilad@kaffe.org>

        Resynced with GNU Classpath.

        2004-01-30  Michael Koch  <konqueror@gmx.de>

        * gnu/java/net/protocol/http/Connection.java
        (getOutputStream): Fixed typo.

        2004-01-12  David Jee  <djee@redhat.com>

        * gnu/java/net/protocol/http/Connection.java
        (sendRequest): Fix a small typo.

        2004-01-12  Michael Koch  <konqueror@gmx.de>

        * gnu/java/net/protocol/http/Connection.java
        (connect): Dont initialize bufferedOutputStream.
        (sendRequest): Handle case when bufferedOutputStream is null.
        (getOutputStream): Throw exception if called after it got connected.
        Initialize bufferedOutputStream.

Members: 
	ChangeLog:1.1972->1.1973 
	libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.6->1.7 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1972 kaffe/ChangeLog:1.1973
--- kaffe/ChangeLog:1.1972	Mon Feb  2 17:11:36 2004
+++ kaffe/ChangeLog	Mon Feb  2 17:25:21 2004
@@ -2,6 +2,28 @@
 
         Resynced with GNU Classpath.
 
+	2004-01-30  Michael Koch  <konqueror@gmx.de>
+
+        * gnu/java/net/protocol/http/Connection.java
+        (getOutputStream): Fixed typo.
+
+	2004-01-12  David Jee  <djee@redhat.com>
+
+        * gnu/java/net/protocol/http/Connection.java
+        (sendRequest): Fix a small typo.
+
+	2004-01-12  Michael Koch  <konqueror@gmx.de>
+
+        * gnu/java/net/protocol/http/Connection.java
+        (connect): Dont initialize bufferedOutputStream.
+        (sendRequest): Handle case when bufferedOutputStream is null.
+        (getOutputStream): Throw exception if called after it got connected.
+        Initialize bufferedOutputStream.
+
+2004-02-02  Dalibor Topic <robilad@kaffe.org>
+
+        Resynced with GNU Classpath.
+
 	2004-01-21  Jeroen Frijters  <jeroen@frijters.net>
 
         * gnu/java/io/PlatformHelper.java (isRootDirectory): Fixed, by
Index: kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java
diff -u kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.6 kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.7
--- kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java:1.6	Wed Dec 31 09:32:17 2003
+++ kaffe/libraries/javalib/gnu/java/net/protocol/http/Connection.java	Mon Feb  2 17:25:23 2004
@@ -168,7 +168,6 @@
     inputStream =
       new DataInputStream(new BufferedInputStream(socket.getInputStream()));
     outputStream = new BufferedOutputStream (socket.getOutputStream());
-    bufferedOutputStream = new ByteArrayOutputStream (256); //default is too small
 
     sendRequest();
     receiveReply();
@@ -226,7 +225,8 @@
       setRequestProperty ("Content-type", "application/x-www-form-urlencoded");
 
     // Set correct content length.
-    setRequestProperty ("Content-length", String.valueOf (bufferedOutputStream.size()));
+    if (bufferedOutputStream != null)
+      setRequestProperty ("Content-length", String.valueOf (bufferedOutputStream.size()));
 
     // Write all req_props name-value pairs to the output writer.
     Iterator itr = getRequestProperties().entrySet().iterator();
@@ -242,8 +242,11 @@
     outputWriter.flush();
 
     // Write content
-    bufferedOutputStream.writeTo (outputStream);
-    outputStream.flush();
+    if (bufferedOutputStream != null)
+      {
+	bufferedOutputStream.writeTo (outputStream);
+	outputStream.flush();
+      }
   }
 
   /**
@@ -382,6 +385,10 @@
    */
   public OutputStream getOutputStream() throws IOException
   {
+    if (connected)
+      throw new ProtocolException
+	("You cannot get an output stream for an existing http connection");
+
     if (!doOutput)
       throw new ProtocolException
         ("Want output stream while haven't setDoOutput(true)");
@@ -389,8 +396,8 @@
     if (!method.equals ("POST")) //But we might support "PUT" in future
       setRequestMethod ("POST");
   
-    if (!connected)
-      connect();
+    if (bufferedOutputStream == null)
+      bufferedOutputStream = new ByteArrayOutputStream (256); //default is too small
     
     return bufferedOutputStream;
   }