hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r630209 - /httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java
Date Fri, 22 Feb 2008 13:57:54 GMT
Author: olegk
Date: Fri Feb 22 05:57:51 2008
New Revision: 630209

URL: http://svn.apache.org/viewvc?rev=630209&view=rev
Log:
HTTPCORE-148: Transfer as many bytes as possible at a time. This fix improves performance
significantly (up to 5x)  

Modified:
    httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java

Modified: httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java?rev=630209&r1=630208&r2=630209&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java
(original)
+++ httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java
Fri Feb 22 05:57:51 2008
@@ -95,9 +95,11 @@
 
         long transferred;
         if(useFileChannels && encoder instanceof FileContentEncoder) {
-            transferred = ((FileContentEncoder)encoder).transfer(fileChannel, idx, 100);
+            transferred = ((FileContentEncoder)encoder)
+                .transfer(fileChannel, idx, Long.MAX_VALUE);
         } else {
-            transferred = fileChannel.transferTo(idx, Long.MAX_VALUE, new ContentEncoderChannel(encoder));
+            transferred = fileChannel.
+                transferTo(idx, Long.MAX_VALUE, new ContentEncoderChannel(encoder));
         }
 
         if(transferred > 0)



Mime
View raw message