]>
Commit | Line | Data |
---|---|---|
f5e17947 | 1 | /* |
f70aedc4 | 2 | * Copyright (C) 1996-2021 The Squid Software Foundation and contributors |
f5e17947 CT |
3 | * |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
7 | */ | |
8 | ||
9 | #include "squid.h" | |
10 | #include "clients/HttpTunnelerAnswer.h" | |
11 | #include "comm/Connection.h" | |
12 | #include "errorpage.h" | |
13 | ||
14 | Http::TunnelerAnswer::~TunnelerAnswer() | |
15 | { | |
16 | delete squidError.get(); | |
17 | } | |
18 | ||
19 | std::ostream & | |
20 | Http::operator <<(std::ostream &os, const TunnelerAnswer &answer) | |
21 | { | |
22 | os << '['; | |
23 | ||
24 | if (const auto squidError = answer.squidError.get()) { | |
25 | os << "SquidErr:" << squidError->page_id; | |
26 | } else { | |
27 | os << "OK"; | |
28 | if (const auto extraBytes = answer.leftovers.length()) | |
29 | os << '+' << extraBytes; | |
30 | } | |
31 | ||
32 | if (answer.peerResponseStatus != Http::scNone) | |
33 | os << ' ' << answer.peerResponseStatus; | |
34 | ||
25b0ce45 CT |
35 | if (answer.conn) |
36 | os << ' ' << answer.conn; | |
37 | ||
f5e17947 CT |
38 | os << ']'; |
39 | return os; | |
40 | } | |
41 |