#include <BodyPipe.h>

Inheritance diagram for BodyPipe:
Collaboration diagram for BodyPipe:

Public Types

enum  { MaxCapacity = 64*1024 }
 
typedef RefCount< BodyPipePointer
 
typedef BodyProducer Producer
 
typedef BodyConsumer Consumer
 
typedef BodyPipeCheckout Checkout
 

Public Member Functions

 BodyPipe (Producer *aProducer)
 
 ~BodyPipe ()
 
void setBodySize (uint64_t aSize)
 
bool bodySizeKnown () const
 
uint64_t bodySize () const
 
uint64_t consumedSize () const
 
uint64_t producedSize () const
 
bool productionEnded () const
 
void clearProducer (bool atEof)
 
size_t putMoreData (const char *buf, size_t size)
 
bool mayNeedMoreData () const
 
bool needsMoreData () const
 
uint64_t unproducedSize () const
 
bool stillProducing (const Producer::Pointer &producer) const
 
void expectProductionEndAfter (uint64_t extraSize)
 sets or checks body size More...
 
bool setConsumerIfNotLate (const Consumer::Pointer &aConsumer)
 
void clearConsumer ()
 
void expectNoConsumption ()
 there will be no more setConsumer() calls More...
 
size_t getMoreData (MemBuf &buf)
 
void consume (size_t size)
 
bool expectMoreAfter (uint64_t offset) const
 
bool exhausted () const
 
bool stillConsuming (const Consumer::Pointer &consumer) const
 
void enableAutoConsumption ()
 
const MemBufbuf () const
 
const char * status () const
 

Protected Member Functions

MemBufcheckOut ()
 
void checkIn (Checkout &checkout)
 
void undoCheckOut (Checkout &checkout)
 
void scheduleBodyDataNotification ()
 
void scheduleBodyEndNotification ()
 
void postConsume (size_t size)
 
void postAppend (size_t size)
 
void startAutoConsumption ()
 

Private Member Functions

 MEMPROXY_CLASS (BodyPipe)
 

Private Attributes

int64_t theBodySize
 
Producer::Pointer theProducer
 
Consumer::Pointer theConsumer
 
uint64_t thePutSize
 
uint64_t theGetSize
 
MemBuf theBuf
 
bool mustAutoConsume
 
bool abortedConsumption
 called BodyProducer::noteBodyConsumerAborted More...
 
bool isCheckedOut
 

Friends

class BodyPipeCheckout
 

Detailed Description

Connects those who produces message body content with those who consume it. For example, connects ConnStateData with FtpStateData OR ICAPModXact with HttpStateData.

Definition at line 90 of file BodyPipe.h.

Member Typedef Documentation

Definition at line 98 of file BodyPipe.h.

Definition at line 97 of file BodyPipe.h.

Definition at line 95 of file BodyPipe.h.

Definition at line 96 of file BodyPipe.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MaxCapacity 

Definition at line 100 of file BodyPipe.h.

Constructor & Destructor Documentation

BodyPipe::BodyPipe ( Producer aProducer)

Definition at line 128 of file BodyPipe.cc.

References debugs, HERE(), MemBuf::init(), MaxCapacity, status(), and theBuf.

BodyPipe::~BodyPipe ( )

Definition at line 139 of file BodyPipe.cc.

References assert, MemBuf::clean(), debugs, HERE(), status(), theBuf, theConsumer, and theProducer.

Member Function Documentation

uint64_t BodyPipe::bodySize ( ) const
void BodyPipe::checkIn ( Checkout checkout)
protected
MemBuf & BodyPipe::checkOut ( )
protected

Definition at line 339 of file BodyPipe.cc.

References assert, isCheckedOut, and theBuf.

void BodyPipe::enableAutoConsumption ( )
bool BodyPipe::expectMoreAfter ( uint64_t  offset) const

Definition at line 167 of file BodyPipe.cc.

References assert, mayNeedMoreData(), productionEnded(), theGetSize, and thePutSize.

Referenced by exhausted().

void BodyPipe::expectProductionEndAfter ( uint64_t  extraSize)

Definition at line 184 of file BodyPipe.cc.

References bodySize(), bodySizeKnown(), Must, size, theBodySize, and thePutSize.

BodyPipe::MEMPROXY_CLASS ( BodyPipe  )
private
bool BodyPipe::needsMoreData ( ) const
inline

Definition at line 119 of file BodyPipe.h.

References bodySizeKnown(), and unproducedSize().

Referenced by mayNeedMoreData().

void BodyPipe::postAppend ( size_t  size)
protected
void BodyPipe::postConsume ( size_t  size)
protected
uint64_t BodyPipe::producedSize ( ) const
inline
bool BodyPipe::productionEnded ( ) const
inline
size_t BodyPipe::putMoreData ( const char *  buf,
size_t  size 
)
void BodyPipe::scheduleBodyDataNotification ( )
protected
void BodyPipe::setBodySize ( uint64_t  aSize)
void BodyPipe::startAutoConsumption ( )
protected
bool BodyPipe::stillProducing ( const Producer::Pointer producer) const
inline
void BodyPipe::undoCheckOut ( Checkout checkout)
protected
uint64_t BodyPipe::unproducedSize ( ) const

Definition at line 179 of file BodyPipe.cc.

References bodySize(), and thePutSize.

Referenced by ConnStateData::mayNeedToReadMoreBody(), needsMoreData(), and putMoreData().

Friends And Related Function Documentation

friend class BodyPipeCheckout
friend

Definition at line 102 of file BodyPipe.h.

Member Data Documentation

bool BodyPipe::abortedConsumption
private

Definition at line 167 of file BodyPipe.h.

Referenced by expectNoConsumption(), setConsumerIfNotLate(), and status().

bool BodyPipe::isCheckedOut
private

Definition at line 168 of file BodyPipe.h.

Referenced by checkIn(), checkOut(), postAppend(), postConsume(), status(), and undoCheckOut().

bool BodyPipe::mustAutoConsume
private
int64_t BodyPipe::theBodySize
private
uint64_t BodyPipe::theGetSize
private

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors