apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ServerState Struct Referenceabstract

#include <basehttp.h>

Inheritance diagram for ServerState:
[legend]
Collaboration diagram for ServerState:
[legend]

Public Types

enum  RunHeadersResult { RUN_HEADERS_OK , RUN_HEADERS_IO_ERROR , RUN_HEADERS_PARSE_ERROR }
 Result of the header acquire. More...
 

Public Member Functions

RunHeadersResult RunHeaders (RequestState &Req, const std::string &Uri)
 Get the headers before the data. More...
 
bool Comp (URI Other) const
 
virtual void Reset ()
 
virtual bool WriteResponse (std::string const &Data)=0
 
virtual ResultState RunData (RequestState &Req)=0
 Transfer the data from the socket. More...
 
virtual ResultState RunDataToDevNull (RequestState &Req)=0
 
virtual ResultState Open ()=0
 
virtual bool IsOpen ()=0
 
virtual bool Close ()=0
 
virtual bool InitHashes (HashStringList const &ExpectedHashes)=0
 
virtual ResultState Die (RequestState &Req)=0
 
virtual bool Flush (FileFd *const File, bool MustComplete=false)=0
 
virtual ResultState Go (bool ToFile, RequestState &Req)=0
 
virtual HashesGetHashes ()=0
 
 ServerState (URI Srv, BaseHttpMethod *Owner)
 
virtual ~ServerState ()
 

Public Attributes

bool Persistent
 
bool PipelineAllowed
 
bool RangesAllowed
 
unsigned long PipelineAnswersReceived
 
bool Pipeline
 
URI ServerName
 
URI Proxy
 
unsigned long TimeOut
 

Protected Member Functions

virtual bool ReadHeaderLines (std::string &Data)=0
 
virtual ResultState LoadNextResponse (bool const ToFile, RequestState &Req)=0
 

Protected Attributes

BaseHttpMethodOwner
 

Detailed Description

Definition at line 65 of file basehttp.h.

Member Enumeration Documentation

◆ RunHeadersResult

Result of the header acquire.

Enumerator
RUN_HEADERS_OK 

Header ok.

RUN_HEADERS_IO_ERROR 

IO error while retrieving.

RUN_HEADERS_PARSE_ERROR 

Parse error after retrieving.

Definition at line 86 of file basehttp.h.

Constructor & Destructor Documentation

◆ ServerState()

ServerState ( URI  Srv,
BaseHttpMethod Owner 
)

Definition at line 262 of file basehttp.cc.

References Reset().

◆ ~ServerState()

virtual ~ServerState ( )
inlinevirtual

Definition at line 115 of file basehttp.h.

Member Function Documentation

◆ Close()

virtual bool Close ( )
pure virtual

Implemented in HttpServerState.

◆ Comp()

bool Comp ( URI  Other) const
inline

Definition at line 97 of file basehttp.h.

References URI::Access, URI::Host, URI::Port, and ServerName.

◆ Die()

virtual ResultState Die ( RequestState Req)
pure virtual

Implemented in HttpServerState.

◆ Flush()

virtual bool Flush ( FileFd *const  File,
bool  MustComplete = false 
)
pure virtual

Implemented in HttpServerState.

◆ GetHashes()

virtual Hashes* GetHashes ( )
pure virtual

◆ Go()

virtual ResultState Go ( bool  ToFile,
RequestState Req 
)
pure virtual

Implemented in HttpServerState.

◆ InitHashes()

virtual bool InitHashes ( HashStringList const &  ExpectedHashes)
pure virtual

Implemented in HttpServerState.

◆ IsOpen()

virtual bool IsOpen ( )
pure virtual

Implemented in HttpServerState.

◆ LoadNextResponse()

virtual ResultState LoadNextResponse ( bool const  ToFile,
RequestState Req 
)
protectedpure virtual

Implemented in HttpServerState.

Referenced by RunHeaders().

◆ Open()

virtual ResultState Open ( )
pure virtual

Implemented in HttpServerState.

◆ ReadHeaderLines()

virtual bool ReadHeaderLines ( std::string &  Data)
protectedpure virtual

Implemented in HttpServerState.

Referenced by RunHeaders().

◆ Reset()

void Reset ( )
virtual

Reimplemented in HttpServerState.

Definition at line 274 of file basehttp.cc.

References Persistent, Pipeline, PipelineAllowed, PipelineAnswersReceived, and RangesAllowed.

Referenced by HttpServerState::Reset(), and ServerState().

◆ RunData()

virtual ResultState RunData ( RequestState Req)
pure virtual

Transfer the data from the socket.

Implemented in HttpServerState.

◆ RunDataToDevNull()

virtual ResultState RunDataToDevNull ( RequestState Req)
pure virtual

Implemented in HttpServerState.

◆ RunHeaders()

◆ WriteResponse()

virtual bool WriteResponse ( std::string const &  Data)
pure virtual

Implemented in HttpServerState.

Member Data Documentation

◆ Owner

◆ Persistent

◆ Pipeline

bool Pipeline

Definition at line 72 of file basehttp.h.

Referenced by RequestState::HeaderLine(), and Reset().

◆ PipelineAllowed

bool PipelineAllowed

Definition at line 68 of file basehttp.h.

Referenced by RequestState::HeaderLine(), and Reset().

◆ PipelineAnswersReceived

unsigned long PipelineAnswersReceived

Definition at line 70 of file basehttp.h.

Referenced by RequestState::HeaderLine(), and Reset().

◆ Proxy

URI Proxy

Definition at line 74 of file basehttp.h.

Referenced by HttpServerState::Open().

◆ RangesAllowed

bool RangesAllowed

Definition at line 69 of file basehttp.h.

Referenced by RequestState::HeaderLine(), and Reset().

◆ ServerName

URI ServerName

Definition at line 73 of file basehttp.h.

Referenced by Comp(), and HttpServerState::Open().

◆ TimeOut

unsigned long TimeOut

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