Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions plugins/experimental/multiplexer/dispatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down