hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1092121 - in /httpcomponents/httpcore/trunk: RELEASE_NOTES.txt httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
Date Thu, 14 Apr 2011 10:59:14 GMT
Author: sebb
Date: Thu Apr 14 10:59:14 2011
New Revision: 1092121

URL: http://svn.apache.org/viewvc?rev=1092121&view=rev
Log:
HTTPCORE-254 Erratic results from metrics

Modified:
    httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java

Modified: httpcomponents/httpcore/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/RELEASE_NOTES.txt?rev=1092121&r1=1092120&r2=1092121&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/trunk/RELEASE_NOTES.txt Thu Apr 14 10:59:14 2011
@@ -1,5 +1,7 @@
 Changes since 4.1
 
+* [HTTPCORE-254]: Erratic results from metrics (sebb)
+
 * [HTTPCORE-242]: Fixed NPE in AsyncNHttpClientHandler caused by an early response to an
   entity enclosing request.
   Contributed by Oleg Kalnichevski <olegk at apache.org>

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java?rev=1092121&r1=1092120&r2=1092121&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
Thu Apr 14 10:59:14 2011
@@ -184,7 +184,11 @@ public abstract class AbstractSessionInp
         // If the remaining capacity is big enough, read directly from the
         // underlying input stream bypassing the buffer.
         if (len > this.minChunkLimit) {
-            return this.instream.read(b, off, len);
+            int read = this.instream.read(b, off, len);
+            if (read > 0) {
+                this.metrics.incrementBytesTransferred(read);
+            }
+            return read;
         } else {
             // otherwise read to the buffer first
             while (!hasBufferedData()) {



Mime
View raw message