Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Tunnel Server RESPONSE dumps #279

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
11 changes: 6 additions & 5 deletions src/clients/HttpTunneler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ Http::Tunneler::handleResponse(const bool eof)
hp = new Http1::ResponseParser;

auto parsedOk = hp->parse(readBuf); // may be refined below

debugs(11, 2, "Tunnel Server " << connection);
debugs(11, 2, "Tunnel Server RESPONSE:\n---------\n" <<
Raw(nullptr, readBuf.rawContent(), readBuf.length()).minLevel(2).gap(false) <<
rousskov marked this conversation as resolved.
Show resolved Hide resolved
"----------");

readBuf = hp->remaining();
if (hp->needsMoreData()) {
if (!eof) {
Expand Down Expand Up @@ -313,11 +319,6 @@ Http::Tunneler::handleResponse(const bool eof)
futureAnswer.peerResponseStatus = rep->sline.status();
request->hier.peer_reply_status = rep->sline.status();

debugs(11, 2, "Tunnel Server " << connection);
debugs(11, 2, "Tunnel Server RESPONSE:\n---------\n" <<
Raw(nullptr, readBuf.rawContent(), rep->hdr_sz).minLevel(2).gap(false) <<
"----------");

// bail if we did not get an HTTP 200 (Connection Established) response
if (rep->sline.status() != Http::scOkay) {
// TODO: To reuse the connection, extract the whole error response.
Expand Down