Index: ServletInputStreamFacade.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletInputStreamFacade.java,v
retrieving revision 1.5
diff -c -r1.5 ServletInputStreamFacade.java
*** ServletInputStreamFacade.java	2001/08/24 04:38:50	1.5
--- ServletInputStreamFacade.java	2001/10/02 02:05:33
***************
*** 77,82 ****
--- 77,83 ----
      private int bytesRead = 0;
      // Stop after reading ContentLength bytes. 
      private int limit = -1;
+     private boolean closed=false;
  
      private Request reqA;
      
***************
*** 98,109 ****
--- 99,113 ----
  
      void recycle() {
  	limit=-1;
+ 	closed=false;
      }
  
      // -------------------- ServletInputStream methods 
  
      public int read() throws IOException {
  	if( dL>0) debug("read() " + limit + " " + bytesRead );
+ 	if(closed)
+ 	    throw new IOException("Stream closed");
  	if (limit == -1) {
  	    // Ask the adapter for more data. We are in the 'no content-length'
  	    // case - i.e. chunked encoding ( acording to http spec CL is required
***************
*** 137,142 ****
--- 141,148 ----
  
      public int read(byte[] b, int off, int len) throws IOException {
  	if( dL>0) debug("read(" +  len + ") " + limit + " " + bytesRead );
+ 	if(closed)
+ 	    throw new IOException("Stream closed");
  	if (limit == -1) {
  	    int numRead = reqA.doRead(b, off, len);
  	    if (numRead > 0) {
***************
*** 166,171 ****
--- 172,185 ----
  
      public int readLine(byte[] b, int off, int len) throws IOException {
  	return super.readLine(b, off, len);
+     }
+     /**
+      * Close the stream.
+      * Since we are recycled, we must avoid super.close() or else
+      * we become permantly unavailable.
+      */
+     public void close() {
+ 	closed=true;
      }
  
      private static int dL=0;
