hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r232897 - /jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
Date Mon, 15 Aug 2005 22:17:07 GMT
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/java/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");



Mime
View raw message