HttpTunnelerAnswer.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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"
11#include "comm/Connection.h"
12#include "errorpage.h"
13
15{
16 delete squidError.get();
17}
18
19std::ostream &
20Http::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
35 if (answer.conn)
36 os << ' ' << answer.conn;
37
38 os << ']';
39 return os;
40}
41
Cbc * get() const
a temporary valid raw Cbc pointer or NULL
Definition: CbcPointer.h:159
Comm::ConnectionPointer conn
~TunnelerAnswer()
deletes squidError if it is still set
StatusCode peerResponseStatus
the status code of the successfully parsed CONNECT response (or scNone)
SBuf leftovers
peer-generated bytes after a positive answer (or empty)
CbcPointer< ErrorState > squidError
problem details (or nil)
size_type length() const
Returns the number of bytes stored in SBuf.
Definition: SBuf.h:415
std::ostream & operator<<(std::ostream &, const TunnelerAnswer &)
@ scNone
Definition: StatusCode.h:21

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors