Public Types | Public Member Functions | Data Fields | Static Public Attributes

ChunkedHandler Struct Reference

#include <HttpTunnel.h>

Collaboration diagram for ChunkedHandler:
Collaboration graph
[legend]

Public Types

enum  ChunkedState {
  CHUNK_READ_CHUNK = 0, CHUNK_READ_SIZE_START, CHUNK_READ_SIZE, CHUNK_READ_SIZE_CRLF,
  CHUNK_READ_TRAILER_BLANK, CHUNK_READ_TRAILER_CR, CHUNK_READ_TRAILER_LINE, CHUNK_READ_ERROR,
  CHUNK_READ_DONE, CHUNK_WRITE_CHUNK, CHUNK_WRITE_DONE, CHUNK_FLOW_CONTROL
}
enum  Action { ACTION_DOCHUNK = 0, ACTION_DECHUNK, ACTION_PASSTHRU }

Public Member Functions

 ChunkedHandler ()
void init (IOBufferReader *buffer_in, HttpTunnelProducer *p)
void init_by_action (IOBufferReader *buffer_in, Action action)
void clear ()
void set_max_chunk_size (int64_t size)
 Set the max chunk size.
bool process_chunked_content ()
bool generate_chunked_content ()

Data Fields

Action action
IOBufferReaderchunked_reader
MIOBufferdechunked_buffer
int64_t dechunked_size
IOBufferReaderdechunked_reader
MIOBufferchunked_buffer
int64_t chunked_size
bool truncation
int64_t skip_bytes
ChunkedState state
int64_t cur_chunk_size
int64_t bytes_left
int last_server_event
int running_sum
int num_digits
Output data.

int64_t max_chunk_size
 The maximum chunk size.
char max_chunk_header [16]
 Caching members to avoid using printf on every chunk.
int max_chunk_header_len

Static Public Attributes

static int const DEFAULT_MAX_CHUNK_SIZE = 4096

Detailed Description

Definition at line 87 of file HttpTunnel.h.


Member Enumeration Documentation

Enumerator:
ACTION_DOCHUNK 
ACTION_DECHUNK 
ACTION_PASSTHRU 

Definition at line 106 of file HttpTunnel.h.

Enumerator:
CHUNK_READ_CHUNK 
CHUNK_READ_SIZE_START 
CHUNK_READ_SIZE 
CHUNK_READ_SIZE_CRLF 
CHUNK_READ_TRAILER_BLANK 
CHUNK_READ_TRAILER_CR 
CHUNK_READ_TRAILER_LINE 
CHUNK_READ_ERROR 
CHUNK_READ_DONE 
CHUNK_WRITE_CHUNK 
CHUNK_WRITE_DONE 
CHUNK_FLOW_CONTROL 

Definition at line 89 of file HttpTunnel.h.


Constructor & Destructor Documentation

ChunkedHandler::ChunkedHandler (  ) 

Definition at line 61 of file HttpTunnel.cc.


Member Function Documentation

void ChunkedHandler::clear ( void   ) 
bool ChunkedHandler::generate_chunked_content (  ) 
void ChunkedHandler::init ( IOBufferReader buffer_in,
HttpTunnelProducer p 
)
void ChunkedHandler::init_by_action ( IOBufferReader buffer_in,
Action  action 
)
bool ChunkedHandler::process_chunked_content (  ) 
void ChunkedHandler::set_max_chunk_size ( int64_t  size  ) 

Set the max chunk size.

If size is zero it is set to DEFAULT_MAX_CHUNK_SIZE.

Definition at line 132 of file HttpTunnel.cc.

References CHUNK_HEADER_FMT, DEFAULT_MAX_CHUNK_SIZE, max_chunk_header, max_chunk_header_len, and max_chunk_size.

Referenced by HttpTunnel::set_producer_chunking_size().


Field Documentation

Definition at line 112 of file HttpTunnel.h.

Referenced by clear().

Definition at line 127 of file HttpTunnel.h.

Referenced by init_by_action().

Definition at line 120 of file HttpTunnel.h.

Referenced by generate_chunked_content(), and init_by_action().

Definition at line 126 of file HttpTunnel.h.

Referenced by init_by_action().

Definition at line 115 of file HttpTunnel.h.

Referenced by clear(), HttpTunnel::deallocate_buffers(), and init_by_action().

Definition at line 116 of file HttpTunnel.h.

Referenced by init_by_action().

int const ChunkedHandler::DEFAULT_MAX_CHUNK_SIZE = 4096 [static]

Definition at line 104 of file HttpTunnel.h.

Referenced by set_max_chunk_size().

Caching members to avoid using printf on every chunk.

It holds the header for a maximal sized chunk which will cover almost all output chunks.

Definition at line 142 of file HttpTunnel.h.

Referenced by generate_chunked_content(), and set_max_chunk_size().

The maximum chunk size.

This is the preferred size as well, used whenever possible.

Definition at line 138 of file HttpTunnel.h.

Referenced by generate_chunked_content(), and set_max_chunk_size().

Definition at line 132 of file HttpTunnel.h.

Referenced by init_by_action().

Definition at line 131 of file HttpTunnel.h.

Referenced by init_by_action().

Definition at line 123 of file HttpTunnel.h.

Referenced by HttpTunnel::set_producer_chunking_action().


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