Namespaces | |
namespace | One |
namespace | Two |
Classes | |
class | Header |
PROXY protocol v1 or v2 header. More... | |
class | Parsed |
successful parsing result More... | |
Typedefs | |
typedef RefCount< Header > | HeaderPointer |
Functions | |
static Two::FieldType | NameToFieldType (const SBuf &) |
FieldNameToFieldType() helper that handles pseudo headers. More... | |
static Two::FieldType | IntegerToFieldType (const SBuf &) |
FieldNameToFieldType() helper that handles integer TLV types. More... | |
const SBuf & | PseudoFieldTypeToFieldName (const Two::FieldType) |
Two::FieldType | FieldNameToFieldType (const SBuf &nameOrId) |
Parsed | Parse (const SBuf &) |
Typedef Documentation
◆ HeaderPointer
typedef RefCount<Header> ProxyProtocol::HeaderPointer |
Function Documentation
◆ FieldNameToFieldType()
ProxyProtocol::Two::FieldType ProxyProtocol::FieldNameToFieldType | ( | const SBuf & | nameOrId | ) |
Parses human-friendly PROXY protocol field type representation. Only pseudo headers can (and should) be represented by their names.
Definition at line 102 of file Elements.cc.
References CharacterSet::DIGIT, IntegerToFieldType(), NameToFieldType(), and Parser::Tokenizer::skipOne().
Referenced by Format::Token::parse().
◆ IntegerToFieldType()
|
static |
Definition at line 73 of file Elements.cc.
References Parser::Tokenizer::atEnd(), Parser::Tokenizer::int64(), max(), Must, Parser::Tokenizer::skip(), TexcHere, and ToSBuf().
Referenced by FieldNameToFieldType().
◆ NameToFieldType()
|
static |
Definition at line 53 of file Elements.cc.
References ProxyProtocol::Two::PseudoHeaderFields, SBuf::startsWith(), TexcHere, and ToSBuf().
Referenced by FieldNameToFieldType().
◆ Parse()
ProxyProtocol::Parsed ProxyProtocol::Parse | ( | const SBuf & | buf | ) |
Parses a PROXY protocol header from the buffer, determining the protocol version (v1 or v2) by the leading magic string.
- Exceptions
-
Parser::BinaryTokenizer::InsufficientInput to ask for more data
- Returns
- the successfully parsed header
Definition at line 242 of file Parser.cc.
References SBuf::length(), ProxyProtocol::Two::Magic, ProxyProtocol::Two::Parse(), Parser::Tokenizer::parsedSize(), Parser::Tokenizer::remaining(), Parser::Tokenizer::skip(), and TexcHere.
Referenced by ConnStateData::parseProxyProtocolHeader().
◆ PseudoFieldTypeToFieldName()
const SBuf & ProxyProtocol::PseudoFieldTypeToFieldName | ( | const Two::FieldType | fieldType | ) |
- Returns
- human-friendly PROXY protocol field name for the given field type from the [htPseudoBegin,htPseudoEnd) range
Definition at line 40 of file Elements.cc.
References assert, and ProxyProtocol::Two::PseudoHeaderFields.
Referenced by ProxyProtocol::Header::toMime().