#include <StatusLine.h>

Collaboration diagram for Http::StatusLine:

Public Member Functions

void init ()
 reset this status-line back to empty state More...
void clean ()
 reset this status-line back to Internal Server Error state More...
void set (const AnyP::ProtocolVersion &newVersion, Http::StatusCode newStatus, const char *newReason=NULL)
void resetReason ()
 reset the reason phrase to its default status code-derived value More...
Http::StatusCode status () const
 retrieve the status code for this status line More...
const char * reason () const
 retrieve the reason string for this status line More...
void packInto (Packable *) const
 pack fields into a Packable object More...
bool parse (const String &protoPrefix, const char *start, const char *end)

Public Attributes

AnyP::ProtocolType protocol
AnyP::ProtocolVersion version
 breakdown of protocol version label: (HTTP/ICY) and (0.9/1.0/1.1) More...

Private Attributes

Http::StatusCode status_
 status code. ie 100 ... 200 ... 404 ... 599 More...
const char * reason_
 points to a constant string (default or supplied), never free()d More...

Detailed Description

Holds the values parsed from an HTTP reply status line.

For example: HTTP/1.1 200 OK

Definition at line 27 of file StatusLine.h.

Member Function Documentation

void Http::StatusLine::clean ( )

Definition at line 23 of file StatusLine.cc.

References NULL, Http::ProtocolVersion(), and Http::scInternalServerError.

Referenced by HttpReply::clean().

void Http::StatusLine::init ( void  )

Definition at line 17 of file StatusLine.cc.

References NULL, Http::ProtocolVersion(), Http::scNone, and set().

Referenced by HttpReply::init().

void Http::StatusLine::packInto ( Packable p) const
bool Http::StatusLine::parse ( const String protoPrefix,
const char *  start,
const char *  end 

Parse a buffer and fill internal structures;

true on success, false otherwise

Definition at line 75 of file StatusLine.cc.

References String::caseCmp(), String::cmp(), debugs, AnyP::PROTO_ICY, Http::scInvalidHeader, String::size(), version, and xisdigit.

Referenced by HttpReply::parseFirstLine().

const char * Http::StatusLine::reason ( ) const

Definition at line 40 of file StatusLine.cc.

References Http::StatusCodeString().

Referenced by peerDigestFetchReply(), and Ftp::Server::writeErrorReply().

void Http::StatusLine::resetReason ( )

Definition at line 42 of file StatusLine.h.

References reason_.

void Http::StatusLine::set ( const AnyP::ProtocolVersion newVersion,
Http::StatusCode  newStatus,
const char *  newReason = NULL 

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 30 of file StatusLine.cc.

References AnyP::PROTO_HTTP, and version.

Referenced by Http::Stream::buildRangeHeader(), HttpReply::httpMsgParseError(), Ftp::HttpReplyWrapper(), init(), HttpReply::make304(), Http::One::Server::processParsedRequest(), HttpStateData::processReplyHeader(), HttpReply::redirect(), HttpReply::setHeaders(), and CacheManager::Start().

Member Data Documentation

AnyP::ProtocolType Http::StatusLine::protocol

By rights protocol name should be a constant "HTTP", with no need for this field to exist. However there are protocols which violate HTTP by sending their own custom formats back with other protocol names (ICY streaming format being the current major problem).

Definition at line 68 of file StatusLine.h.

Referenced by clientReplyContext::buildReplyHeader(), clientReplyContext::cloneReply(), and HttpStateData::processReplyHeader().

const char* Http::StatusLine::reason_

Definition at line 77 of file StatusLine.h.

Referenced by resetReason().

Http::StatusCode Http::StatusLine::status_

Definition at line 74 of file StatusLine.h.

Referenced by status().

The documentation for this class was generated from the following files:






Web Site Translations