You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2015/12/19 21:08:29 UTC

trafficserver git commit: [TS-4091] addressing internal headers This close #387.

Repository: trafficserver
Updated Branches:
  refs/heads/master a86f0c5e9 -> f3cb1a06d


[TS-4091] addressing internal headers
This close #387.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f3cb1a06
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f3cb1a06
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f3cb1a06

Branch: refs/heads/master
Commit: f3cb1a06d16bbdd82eb98efac717805b3494abce
Parents: a86f0c5
Author: Daniel Vitor Morilha <dm...@yahoo-inc.com>
Authored: Fri Dec 18 13:56:08 2015 -0800
Committer: Alan M. Carroll <am...@apache.org>
Committed: Sat Dec 19 14:04:15 2015 -0600

----------------------------------------------------------------------
 plugins/experimental/multiplexer/dispatch.cc | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f3cb1a06/plugins/experimental/multiplexer/dispatch.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/multiplexer/dispatch.cc b/plugins/experimental/multiplexer/dispatch.cc
index 2ef49d0..911bb1a 100644
--- a/plugins/experimental/multiplexer/dispatch.cc
+++ b/plugins/experimental/multiplexer/dispatch.cc
@@ -35,16 +35,21 @@ extern Statistics statistics;
 
 extern size_t timeout;
 
-Request::Request(const std::string &h, const TSMBuffer b, const TSMLoc l)
-  : host(h), length(TSHttpHdrLengthGet(b, l)), io(new ats::io::IO())
+Request::Request(const std::string &h, const TSMBuffer b, const TSMLoc l) : host(h), length(0), io(new ats::io::IO())
 {
   assert(!host.empty());
   assert(b != NULL);
   assert(l != NULL);
-  assert(length > 0);
   assert(io.get() != NULL);
   TSHttpHdrPrint(b, l, io->buffer);
-  assert(length == TSIOBufferReaderAvail(io->reader));
+  length = TSIOBufferReaderAvail(io->reader);
+  assert(length > 0);
+  /*
+   * TSHttpHdrLengthGet returns the size with possible "internal" headers
+   * which are not printed by TSHttpHdrPrint.
+   * Therefore the greater than or equal comparisson
+  */
+  assert(TSHttpHdrLengthGet(b, l) >= length);
 }
 
 Request::Request(const Request &r) : host(r.host), length(r.length), io(const_cast<Request &>(r).io.release())