HttpTunnelerAnswer.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 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 
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 
35  os << ']';
36  return os;
37 }
38 
size_type length() const
Returns the number of bytes stored in SBuf.
Definition: SBuf.h:404
int page_id
Definition: errorpage.h:172
StatusCode peerResponseStatus
the status code of the successfully parsed CONNECT response (or scNone)
~TunnelerAnswer()
deletes squidError if it is still set
SBuf leftovers
peer-generated bytes after a positive answer (or empty)
std::ostream & operator<<(std::ostream &, const Http::TunnelerAnswer &)
Cbc * get() const
a temporary valid raw Cbc pointer or NULL
Definition: CbcPointer.h:162
CbcPointer< ErrorState > squidError
problem details (or nil)

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors