trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] branch 8.0.x updated: no point in calling decode a second time if available is already 0
Date Thu, 30 Aug 2018 17:46:09 GMT
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.0.x by this push:
     new 6b17598  no point in calling decode a second time if available is already 0
6b17598 is described below

commit 6b17598a84ada359f2016cbcf966cef9d7eb9ffd
Author: Dan M <daniel.morilha@netlify.com>
AuthorDate: Wed Aug 29 13:14:11 2018 -0700

    no point in calling decode a second time if available is already 0
    
    keeping it backward compatible and still calling data() when available is 0
    
    (cherry picked from commit 09ca8e87c656c97789f144691c6e92235ae4d3f6)
---
 plugins/experimental/multiplexer/fetcher.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/plugins/experimental/multiplexer/fetcher.h b/plugins/experimental/multiplexer/fetcher.h
index 4bc97a1..a431d1e 100644
--- a/plugins/experimental/multiplexer/fetcher.h
+++ b/plugins/experimental/multiplexer/fetcher.h
@@ -215,11 +215,14 @@ template <class T> struct HttpTransaction {
         if (!self->parsingHeaders_) {
           if (self->chunkDecoder_ != NULL) {
             available = self->chunkDecoder_->decode(self->in_->reader);
-            do {
+            if (available == 0) {
+              self->t_.data(self->in_->reader, available);
+            }
+            while (available > 0) {
               self->t_.data(self->in_->reader, available);
               TSIOBufferReaderConsume(self->in_->reader, available);
               available = self->chunkDecoder_->decode(self->in_->reader);
-            } while (available > 0);
+            }
           } else {
             self->t_.data(self->in_->reader, available);
             TSIOBufferReaderConsume(self->in_->reader, available);


Mime
View raw message