[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpcomponents-commits
Subject:    svn commit: r232897 -
From:       olegk () apache ! org
Date:       2005-08-15 22:17:07
Message-ID: 20050815221709.2425.qmail () minotaur ! apache ! org
[Download RAW message or body]

Author: olegk
Date: Mon Aug 15 15:17:00 2005
New Revision: 232897

URL: http://svn.apache.org/viewcvs?rev=232897&view=rev
Log:
Fixed processing of partially consumed requests

Modified:
    jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java


Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
                
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/j \
ava/org/apache/http/coyote/impl/HttpConnectionProcessor.java?rev=232897&r1=232896&r2=232897&view=diff
 ==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java \
                (original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java \
Mon Aug 15 15:17:00 2005 @@ -109,7 +109,9 @@
     
     private HttpEntity in = null;
     private CoyoteHttpEntity out = null;
-    
+
+	private byte[] inbuffer = new byte[1024];
+	
     public HttpConnectionProcessor(
             final HttpServerConnection conn,
             final HttpParams params,
@@ -160,6 +162,7 @@
                             sendHttpResponse();
                             this.coyoteres.setCommitted(true);
                         }
+                        closeInputBuffer();
                         closeOutputBuffer();
                     	manageHttpConnection();
                         reset();
@@ -256,6 +259,13 @@
     	}
     }
 
+    private void closeInputBuffer() throws IOException {
+    	if (this.in != null) {
+    		while (this.in.getContent().read(this.inbuffer) != -1) {
+    		}
+    	}
+    }
+    
     private void flushOutputBuffer() throws IOException {
         if (this.out != null) {
             this.out.flush();
@@ -517,8 +527,6 @@
         }
 	}
 
-	private byte[] inbuffer = new byte[1024];
-	
 	public int doRead(final ByteChunk chunk, final Request request) throws IOException \
{  if (chunk == null) {
 			throw new IllegalArgumentException("Byte chunk may not be null");


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic