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)  

CircleBuf Class Reference

#include <http.h>

Collaboration diagram for CircleBuf:
[legend]

Public Member Functions

bool Read (std::unique_ptr< MethodFd > const &Fd)
 
bool Read (std::string const &Data)
 
bool Write (std::unique_ptr< MethodFd > const &Fd)
 
bool Write (std::string &Data)
 
bool WriteTillEl (std::string &Data, bool Single=false)
 
void Limit (long long Max)
 
bool IsLimit () const
 
void Print () const
 
bool ReadSpace () const
 
bool WriteSpace () const
 
void Reset ()
 
 CircleBuf (HttpMethod const *const Owner, unsigned long long Size)
 
 ~CircleBuf ()
 

Public Attributes

HashesHash
 
unsigned long long TotalWriten
 

Private Member Functions

unsigned long long LeftRead () const
 
unsigned long long LeftWrite () const
 
void FillOut ()
 

Private Attributes

unsigned char * Buf
 
unsigned long long Size
 
unsigned long long InP
 
unsigned long long OutP
 
std::string OutQueue
 
unsigned long long StrPos
 
unsigned long long MaxGet
 

Static Private Attributes

static unsigned long long BwReadLimit =0
 
static unsigned long long BwTickReadData =0
 
static std::chrono::steady_clock::duration BwReadTick {0}
 
static const unsigned int BW_HZ =10
 

Detailed Description

Definition at line 31 of file http.h.

Constructor & Destructor Documentation

◆ CircleBuf()

CircleBuf ( HttpMethod const *const  Owner,
unsigned long long  Size 
)

Definition at line 64 of file http.cc.

References Buf, BwReadLimit, aptMethod::ConfigFindI(), Reset(), and Size.

◆ ~CircleBuf()

~CircleBuf ( )

Definition at line 273 of file http.cc.

References Buf, and Hash.

Member Function Documentation

◆ FillOut()

void FillOut ( )
private

Definition at line 161 of file http.cc.

References Buf, InP, LeftRead(), OutP, OutQueue, Size, and StrPos.

Referenced by Read(), and Write().

◆ IsLimit()

bool IsLimit ( ) const
inline

Definition at line 80 of file http.h.

References MaxGet, and OutP.

Referenced by HttpServerState::Die(), HttpServerState::Flush(), and HttpServerState::RunData().

◆ LeftRead()

unsigned long long LeftRead ( ) const
inlineprivate

Definition at line 46 of file http.h.

References InP, OutP, and Size.

Referenced by FillOut(), and Read().

◆ LeftWrite()

unsigned long long LeftWrite ( ) const
inlineprivate

Definition at line 53 of file http.h.

References InP, MaxGet, OutP, and Size.

Referenced by Write(), and WriteTillEl().

◆ Limit()

void Limit ( long long  Max)
inline

Definition at line 79 of file http.h.

References MaxGet, and OutP.

Referenced by HttpServerState::Die(), and HttpServerState::RunData().

◆ Print()

void Print ( ) const
inline

Definition at line 81 of file http.h.

References MaxGet, and OutP.

◆ Read() [1/2]

bool Read ( std::string const &  Data)

Definition at line 151 of file http.cc.

References FillOut(), and OutQueue.

◆ Read() [2/2]

bool Read ( std::unique_ptr< MethodFd > const &  Fd)

◆ ReadSpace()

bool ReadSpace ( ) const
inline

Definition at line 84 of file http.h.

References InP, OutP, and Size.

Referenced by HttpServerState::Go(), and UnwrapHTTPConnect().

◆ Reset()

void Reset ( )

Definition at line 76 of file http.cc.

References Hash, InP, MaxGet, OutP, OutQueue, StrPos, and TotalWriten.

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

◆ Write() [1/2]

bool Write ( std::string &  Data)

Definition at line 266 of file http.cc.

References Buf, LeftWrite(), OutP, and Size.

◆ Write() [2/2]

bool Write ( std::unique_ptr< MethodFd > const &  Fd)

◆ WriteSpace()

bool WriteSpace ( ) const
inline

Definition at line 85 of file http.h.

References InP, and OutP.

Referenced by HttpServerState::Die(), HttpServerState::Flush(), HttpServerState::Go(), and UnwrapHTTPConnect().

◆ WriteTillEl()

bool WriteTillEl ( std::string &  Data,
bool  Single = false 
)

Definition at line 229 of file http.cc.

References Buf, I, InP, LeftWrite(), OutP, and Size.

Referenced by HttpServerState::ReadHeaderLines(), HttpServerState::RunData(), and UnwrapHTTPConnect().

Member Data Documentation

◆ Buf

unsigned char* Buf
private

Definition at line 33 of file http.h.

Referenced by CircleBuf(), FillOut(), Read(), Write(), WriteTillEl(), and ~CircleBuf().

◆ BW_HZ

const unsigned int BW_HZ =10
staticprivate

Definition at line 44 of file http.h.

Referenced by Read().

◆ BwReadLimit

unsigned long long BwReadLimit =0
staticprivate

Definition at line 41 of file http.h.

Referenced by CircleBuf(), and Read().

◆ BwReadTick

std::chrono::steady_clock::duration BwReadTick {0}
staticprivate

Definition at line 43 of file http.h.

Referenced by Read().

◆ BwTickReadData

unsigned long long BwTickReadData =0
staticprivate

Definition at line 42 of file http.h.

Referenced by Read().

◆ Hash

Hashes* Hash

◆ InP

unsigned long long InP
private

Definition at line 35 of file http.h.

Referenced by FillOut(), LeftRead(), LeftWrite(), Read(), ReadSpace(), Reset(), Write(), WriteSpace(), and WriteTillEl().

◆ MaxGet

unsigned long long MaxGet
private

Definition at line 39 of file http.h.

Referenced by IsLimit(), LeftWrite(), Limit(), Print(), Reset(), and Write().

◆ OutP

unsigned long long OutP
private

◆ OutQueue

std::string OutQueue
private

Definition at line 37 of file http.h.

Referenced by FillOut(), Read(), and Reset().

◆ Size

unsigned long long Size
private

Definition at line 34 of file http.h.

Referenced by CircleBuf(), FillOut(), LeftRead(), LeftWrite(), Read(), ReadSpace(), Write(), and WriteTillEl().

◆ StrPos

unsigned long long StrPos
private

Definition at line 38 of file http.h.

Referenced by FillOut(), and Reset().

◆ TotalWriten

unsigned long long TotalWriten

Definition at line 67 of file http.h.

Referenced by Reset(), and Write().


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