|
Squid Web Cache v8/master
|
#include <StatusLine.h>
Public Member Functions | |
| void | init () |
| reset this status-line back to empty state | |
| void | clean () |
| reset this status-line back to Internal Server Error state | |
| void | set (const AnyP::ProtocolVersion &newVersion, Http::StatusCode newStatus, const char *newReason=nullptr) |
| void | resetReason () |
| reset the reason phrase to its default status code-derived value | |
| Http::StatusCode | status () const |
| retrieve the status code for this status line | |
| const char * | reason () const |
| retrieve the reason string for this status line | |
| size_t | packedLength () const |
| expected size of packInto() output | |
| void | packInto (Packable *) const |
| pack fields into a Packable object | |
| bool | parse (const String &protoPrefix, const char *start, const char *end) |
Public Attributes | |
| AnyP::ProtocolVersion | version |
| breakdown of protocol version label: (HTTP/ICY) and (0.9/1.0/1.1) | |
Private Attributes | |
| Http::StatusCode | status_ = scNone |
| status code. ie 100 ... 200 ... 404 ... 599 | |
| const char * | reason_ = nullptr |
| points to a constant string (default or supplied), never free()d | |
Holds the values parsed from an HTTP-like reply status line.
For example: HTTP/1.1 200 OK
Definition at line 27 of file StatusLine.h.
| void Http::StatusLine::clean | ( | ) |
Definition at line 28 of file StatusLine.cc.
References Http::ProtocolVersion(), and Http::scInternalServerError.
Referenced by HttpReply::clean().
| void Http::StatusLine::init | ( | ) |
Definition at line 22 of file StatusLine.cc.
References Http::ProtocolVersion(), Http::scNone, and set().
Referenced by HttpReply::init().
| size_t Http::StatusLine::packedLength | ( | ) | const |
Definition at line 50 of file StatusLine.cc.
References AnyP::PROTO_ICY, Http::scInternalServerError, Http::scNone, Http::StatusCodeString(), and version.
Referenced by HttpReply::prefixLen().
| void Http::StatusLine::packInto | ( | Packable * | p | ) | const |
Definition at line 86 of file StatusLine.cc.
References Packable::appendf(), assert, DBG_IMPORTANT, debugs, AnyP::PROTO_ICY, Http::scInternalServerError, Http::scNone, Http::StatusCodeString(), and version.
Referenced by HttpReply::packFirstLineInto(), and HttpReply::packHeadersUsingFastPacker().
| bool Http::StatusLine::parse | ( | const String & | protoPrefix, |
| const char * | start, | ||
| const char * | end | ||
| ) |
Parse a buffer and fill internal structures;
Definition at line 124 of file StatusLine.cc.
References assert, SBuf::assign(), String::caseCmp(), String::cmp(), CurrentException(), debugs, Http::One::ResponseParser::ParseResponseStatus(), AnyP::PROTO_ICY, Http::scInvalidHeader, String::size(), version, and xisdigit.
Referenced by HttpReply::parseFirstLine().
| const char * Http::StatusLine::reason | ( | ) | const |
Definition at line 44 of file StatusLine.cc.
References Http::StatusCodeString().
Referenced by Ftp::Server::writeErrorReply().
|
inline |
Definition at line 42 of file StatusLine.h.
References reason_.
| void Http::StatusLine::set | ( | const AnyP::ProtocolVersion & | newVersion, |
| Http::StatusCode | newStatus, | ||
| const char * | newReason = nullptr |
||
| ) |
set this status-line to the given values when reason is NULL the default message text for this StatusCode will be used when reason is not NULL, it must not point to a dynamically allocated value
Definition at line 35 of file StatusLine.cc.
References version.
Referenced by Http::Stream::buildRangeHeader(), Http::Tunneler::handleResponse(), HttpReply::httpMsgParseError(), Ftp::HttpReplyWrapper(), init(), HttpReply::make304(), HttpReply::MakeConnectionEstablished(), Http::One::Server::processParsedRequest(), HttpStateData::processReplyHeader(), HttpReply::redirect(), HttpReply::setHeaders(), and CacheManager::start().
|
inline |
Definition at line 45 of file StatusLine.h.
References status_.
Referenced by ErrorState::ErrorState(), Auth::UserRequest::AddReplyAuthHeader(), HttpReply::bodySize(), Http::Stream::buildRangeHeader(), clientReplyContext::buildReplyHeader(), Adaptation::Icap::Launcher::canRepeat(), FwdState::complete(), Adaptation::Icap::Options::configure(), HttpReply::configureContentLengthInterpreter(), HttpReply::contentRange(), HttpReply::expectingBody(), Adaptation::Icap::ModXact::finalizeLogInfo(), HttpStateData::handle1xx(), Ftp::Server::handleDataReply(), clientReplyContext::handleIMSReply(), Http::Tunneler::handleResponse(), HttpStateData::haveParsedReplyHeaders(), HttpReply::hdrCacheInit(), Client::maybePurgeOthers(), netdbExchangeHandleReply(), peerDigestFetchReply(), clientReplyContext::processConditional(), clientReplyContext::processReplyAccess(), FwdState::reforward(), HttpReply::removeIrrelevantContentLength(), HttpStateData::reusableReply(), clientReplyContext::setReplyToReply(), storeLog(), and Http::One::Server::writeControlMsgAndCall().
|
private |
Definition at line 72 of file StatusLine.h.
Referenced by resetReason().
|
private |
Definition at line 69 of file StatusLine.h.
Referenced by status().
| AnyP::ProtocolVersion Http::StatusLine::version |
Definition at line 65 of file StatusLine.h.
Referenced by HttpReply::bodySize(), Http::Stream::buildRangeHeader(), clientReplyContext::buildReplyHeader(), clientReplyContext::cloneReply(), and HttpReply::hdrCacheInit().