You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2018/08/30 17:43:46 UTC

[trafficserver] branch master updated: no point in calling decode a second time if available is already 0

This is an automated email from the ASF dual-hosted git repository.

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


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

commit 09ca8e87c656c97789f144691c6e92235ae4d3f6
Author: Dan M <da...@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
---
 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);