hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r365743 - /jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java
Date Tue, 03 Jan 2006 20:49:22 GMT
Author: olegk
Date: Tue Jan  3 12:49:10 2006
New Revision: 365743

URL: http://svn.apache.org/viewcvs?rev=365743&view=rev
Log:
When the byte array is larger then MAX_CHUNK write it directly to the output stream

Modified:
    jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java

Modified: jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java
URL: http://svn.apache.org/viewcvs/jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java?rev=365743&r1=365742&r2=365743&view=diff
==============================================================================
--- jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java
(original)
+++ jakarta/httpcomponents/trunk/http-core/src/java/org/apache/http/impl/io/AbstractHttpDataTransmitter.java
Tue Jan  3 12:49:10 2006
@@ -47,6 +47,8 @@
  */
 public abstract class AbstractHttpDataTransmitter implements HttpDataTransmitter {
 
+    private static int MAX_CHUNK = 256;
+    
     private static final int CR = 13;
     private static final int LF = 10;
     private static final byte[] CRLF = new byte[] {CR, LF};
@@ -87,7 +89,7 @@
         // Do not want to buffer largish chunks
         // if the byte array is larger then MAX_CHUNK
         // write it directly to the output stream
-        if (len > this.buffer.capacity()) {
+        if (len > MAX_CHUNK || len > this.buffer.capacity()) {
             // flush the buffer
             flushBuffer();
             // write directly to the out stream



Mime
View raw message