Libevent Code Doxygen document
Public Member Functions | Public Attributes | List of all members
evbuffer Struct Reference
Collaboration diagram for evbuffer:
Collaboration graph
[legend]

Public Member Functions

 LIST_HEAD (evbuffer_cb_queue, evbuffer_cb_entry) callbacks
 

Public Attributes

struct evbuffer_chainfirst
 
struct evbuffer_chainlast
 
struct evbuffer_chain ** last_with_datap
 
size_t total_len
 
size_t n_add_for_cb
 
size_t n_del_for_cb
 
void * lock
 
unsigned own_lock: 1
 
unsigned freeze_start: 1
 
unsigned freeze_end: 1
 
unsigned deferred_cbs: 1
 
ev_uint32_t flags
 
struct event_basecb_queue
 
int refcnt
 
struct event_callback deferred
 
struct buffereventparent
 

Member Function Documentation

◆ LIST_HEAD()

evbuffer::LIST_HEAD ( evbuffer_cb_queue  ,
evbuffer_cb_entry   
)

A doubly-linked-list of callback functions

Member Data Documentation

◆ cb_queue

struct event_base* evbuffer::cb_queue

Used to implement deferred callbacks.

◆ deferred

struct event_callback evbuffer::deferred

A struct event_callback handle to make all of this buffer's callbacks invoked from the event loop.

◆ deferred_cbs

unsigned evbuffer::deferred_cbs

True iff this evbuffer's callbacks are not invoked immediately upon a change in the buffer, but instead are deferred to be invoked from the event_base's loop. Useful for preventing enormous stack overflows when we have mutually recursive callbacks, and for serializing callbacks in a single thread.

◆ first

struct evbuffer_chain* evbuffer::first

The first chain in this buffer's linked list of chains.

◆ flags

ev_uint32_t evbuffer::flags

Zero or more EVBUFFER_FLAG_* bits

◆ freeze_end

unsigned evbuffer::freeze_end

True iff we should not allow changes to the end of the buffer (appends)

◆ freeze_start

unsigned evbuffer::freeze_start

True iff we should not allow changes to the front of the buffer (drains or prepends).

◆ last

struct evbuffer_chain* evbuffer::last

The last chain in this buffer's linked list of chains.

◆ last_with_datap

struct evbuffer_chain** evbuffer::last_with_datap

Pointer to the next pointer pointing at the 'last_with_data' chain.

To unpack:

The last_with_data chain is the last chain that has any data in it. If all chains in the buffer are empty, it is the first chain. If the buffer has no chains, it is NULL.

The last_with_datap pointer points at whatever 'next' pointer pointing at the last_with_data chain. If the last_with_data chain is the first chain, or it is NULL, then the last_with_datap pointer is &buf->first.

◆ lock

void* evbuffer::lock

A lock used to mediate access to this buffer.

◆ n_add_for_cb

size_t evbuffer::n_add_for_cb

Number of bytes we have added to the buffer since we last tried to invoke callbacks.

◆ n_del_for_cb

size_t evbuffer::n_del_for_cb

Number of bytes we have removed from the buffer since we last tried to invoke callbacks.

◆ own_lock

unsigned evbuffer::own_lock

True iff we should free the lock field when we free this evbuffer.

◆ parent

struct bufferevent* evbuffer::parent

The parent bufferevent object this evbuffer belongs to. NULL if the evbuffer stands alone.

◆ refcnt

int evbuffer::refcnt

A reference count on this evbuffer. When the reference count reaches 0, the buffer is destroyed. Manipulated with evbuffer_incref and evbuffer_decref_and_unlock and evbuffer_free.

◆ total_len

size_t evbuffer::total_len

Total amount of bytes stored in all chains.


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