Add Realm -> hang and HTTP/0.9 PUT failures

Alexandre Rafalovitch writes:
 > Ok, it seems I isolated the problem described in a post "new Add Realm
 > Problem with 1a3 under OS2". Looks like it  has nothing to do with OS2 at
 > all, but is a subtle bug of Jigsaw.
 > 
 > Basicaly, the hang happens when keep-alive is set to false and then Add
 > Realm is attempted.
 > If keep-alive is true, no problems, with keep-alive set to false, Jigsaw
 > hangs. It does not depend on browser either. I used Netscape2.02 on Mac and
 > Lynx on Unix with the same result (can I have credits for that hour I spent
 > debugging Jigsaw? :-} ).
 > 
 > The hang itself happens because of the exception rised deep within Jigsaw
 > bowels that propogates up to the Thread level and kills at least one of the
 > clients, possibly more.

This was not really the problem, the problem was in fact due to a last
minute hack (before releasing, that's never good) trying to solve a
problem with HTTP/1.0 PUT. Anyway, the fix is more general, find
enclosed a patch ... Note there is still a FIXME in the patched code,
which as stated needs to be fix (0.9 POST will fail right now, BTW thi
probably explains why 0.9 PUT failed - I'll send another patch...)

Alex, thanks for your time, whenever jigsaw.w3.org comes up I will
maintain a list of contributors there ;-)

Anselm.
===================================================================
RCS file: /afs/w3.org/CVS-Repository/WWW/Jigsaw/src/classes/w3c/jigsaw/http/Request.java,v
retrieving revision 1.15
diff -u -r1.15 Request.java
--- Request.java	1996/09/13 19:54:48	1.15
+++ Request.java	1996/10/22 07:56:45
@@ -36,8 +36,10 @@
 	}
     }
 
-    protected Client     client = null ;
-    protected MimeParser parser = null;
+    protected Client      client = null;
+    protected MimeParser  parser = null;
+    protected InputStream in     = null;
+
     boolean is_proxy = false;
 
     /**
@@ -219,23 +221,26 @@
     public InputStream getInputStream()
 	throws IOException
     {
+	if ( in != null )
+	    return in;
 	// Find out which method is used to the length:
 	int len = getContentLength();
 	if ( len >= 0 ) {
-	    return new ContentLengthInputStream(parser.getInputStream(), len);
-	}
-	// No content length, try out chunked encoding:
-	String te[] = getTransferEncoding() ;
-	if ( te != null ) {
-	    for (int i = 0 ; i < te.length ; i++) {
-		if (te[i].equals("chunked")) 
-		    return new ChunkedInputStream(parser.getInputStream());
+	    in = new ContentLengthInputStream(parser.getInputStream(), len);
+	} else {
+	    // No content length, try out chunked encoding:
+	    String te[] = getTransferEncoding() ;
+	    if ( te != null ) {
+		for (int i = 0 ; i < te.length ; i++) {
+		    if (te[i].equals("chunked")) 
+			in = new ChunkedInputStream(parser.getInputStream());
+		}
 	    }
 	}
 	// Everything has failed, we assume the connection will close:
 	// FIXME CLOSE THE CONNECTION !
 	//	return parser.getInputStream();
-	return null;
+	return in;
     }
 
     /**

Received on Tuesday, 22 October 1996 05:01:29 UTC