From 6bccda0a36e3f32d3da0b82e02c256d6e74dd7a3 Mon Sep 17 00:00:00 2001 From: Daniel Vitor Morilha Date: Fri, 18 Dec 2015 13:56:08 -0800 Subject: [PATCH 1/2] [TS-4091] addressing internal headers --- plugins/experimental/multiplexer/dispatch.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/experimental/multiplexer/dispatch.cc b/plugins/experimental/multiplexer/dispatch.cc index 2ef49d0df45..195b135c25c 100644 --- a/plugins/experimental/multiplexer/dispatch.cc +++ b/plugins/experimental/multiplexer/dispatch.cc @@ -36,15 +36,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()) + : 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(r).io.release()) From e1433d2a303e40e2132157222f041250e1085184 Mon Sep 17 00:00:00 2001 From: Daniel Vitor Morilha Date: Fri, 18 Dec 2015 13:58:41 -0800 Subject: [PATCH 2/2] [TS-4091] clang-format --- plugins/experimental/multiplexer/dispatch.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/experimental/multiplexer/dispatch.cc b/plugins/experimental/multiplexer/dispatch.cc index 195b135c25c..911bb1aea68 100644 --- a/plugins/experimental/multiplexer/dispatch.cc +++ b/plugins/experimental/multiplexer/dispatch.cc @@ -35,8 +35,7 @@ extern Statistics statistics; extern size_t timeout; -Request::Request(const std::string &h, const TSMBuffer b, const TSMLoc l) - : host(h), length(0), 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);