Classes | |
struct | FullId |
A full ID value for a FastCGI request. More... | |
class | Header |
Data structure used as the header for FastCGI records. More... | |
class | BeginRequest |
Data structure used as the body for FastCGI records with a RecordType of BEGIN_REQUEST. More... | |
class | UnknownType |
Data structure used as the body for FastCGI records with a RecordType of UNKNOWN_TYPE. More... | |
class | EndRequest |
Data structure used as the body for FastCGI records with a RecordType of END_REQUEST. More... | |
struct | ManagementReply |
Used for the reply of FastCGI management records of type GET_VALUES. More... | |
Typedefs | |
typedef uint16_t | RequestId |
The request ID of a FastCGI request. | |
Enumerations | |
enum | RecordType { BEGIN_REQUEST = 1, ABORT_REQUEST = 2, END_REQUEST = 3, PARAMS = 4, IN = 5, OUT = 6, ERR = 7, DATA = 8, GET_VALUES = 9, GET_VALUES_RESULT = 10, UNKNOWN_TYPE = 11 } |
Defines the types of records within the FastCGI protocol. More... | |
enum | Role { RESPONDER = 1, AUTHORIZER = 2, FILTER = 3 } |
Defines the possible roles a FastCGI application may play. More... | |
enum | ProtocolStatus { REQUEST_COMPLETE = 0, CANT_MPX_CONN = 1, OVERLOADED = 2, UNKNOWN_ROLE = 3 } |
Possible statuses a request may declare when complete. More... | |
Functions | |
bool | operator> (const FullId &x, const FullId &y) |
Compare between two FullId variables. | |
bool | operator< (const FullId &x, const FullId &y) |
Compare between two FullId variables. | |
bool | operator== (const FullId &x, const FullId &y) |
Compare between two FullId variables. | |
template<class T > | |
T | readBigEndian (T value) |
Read in a big endian value. | |
bool | processParamHeader (const char *data, size_t dataSize, const char *&name, size_t &nameSize, const char *&value, size_t &valueSize) |
Process the body of a FastCGI parameter record. | |
Variables | |
char * | recordTypeLabels [] = { "INVALID", "BEGIN_REQUEST", "ABORT_REQUEST", "END_REQUEST", "PARAMS", "IN", "OUT", "ERR", "DATA", "GET_VALUES", "GET_VALUES_RESULT", "UNKNOWN_TYPE" } |
Defines text labels for the RecordType values. | |
const int | version = 1 |
The version of the FastCGI protocol that this adheres to. | |
const int | chunkSize = 8 |
All FastCGI records will be a multiple of this many bytes. | |
ManagementReply< 14, 2, 8 > | maxConnsReply |
Reply record that will be sent when asked the maximum allowed file descriptors open at a time. | |
ManagementReply< 13, 2, 1 > | maxReqsReply |
Reply record that will be sent when asked the maximum allowed requests at a time. | |
ManagementReply< 15, 1, 8 > | mpxsConnsReply |
Reply record that will be sent when asked if requests can be multiplexed over a single connections. |
The Protocol namespace defines the data structures and constants used by the FastCGI protocol version 1. All data has been modelled after the official FastCGI protocol specification located at http://www.fastcgi.com/devkit/doc/fcgi-spec.html
typedef uint16_t Fastcgipp::Protocol::RequestId |
Defines the types of records within the FastCGI protocol.
BEGIN_REQUEST | |
ABORT_REQUEST | |
END_REQUEST | |
PARAMS | |
IN | |
OUT | |
ERR | |
DATA | |
GET_VALUES | |
GET_VALUES_RESULT | |
UNKNOWN_TYPE |
Definition at line 67 of file protocol.hpp.
Defines the possible roles a FastCGI application may play.
Definition at line 96 of file protocol.hpp.
bool Fastcgipp::Protocol::operator< | ( | const FullId & | x, | |
const FullId & | y | |||
) | [inline] |
Compare between two FullId variables.
This comparator casts the structures as 32 bit integers and compares them as such.
Definition at line 111 of file protocol.hpp.
References Fastcgipp::Protocol::FullId::fcgiId.
bool Fastcgipp::Protocol::operator== | ( | const FullId & | x, | |
const FullId & | y | |||
) | [inline] |
Compare between two FullId variables.
This comparator casts the structures as 32 bit integers and compares them as such.
Definition at line 117 of file protocol.hpp.
References Fastcgipp::Protocol::FullId::fcgiId.
bool Fastcgipp::Protocol::operator> | ( | const FullId & | x, | |
const FullId & | y | |||
) | [inline] |
Compare between two FullId variables.
This comparator casts the structures as 32 bit integers and compares them as such.
Definition at line 105 of file protocol.hpp.
References Fastcgipp::Protocol::FullId::fcgiId.
bool Fastcgipp::Protocol::processParamHeader | ( | const char * | data, | |
size_t | dataSize, | |||
const char *& | name, | |||
size_t & | nameSize, | |||
const char *& | value, | |||
size_t & | valueSize | |||
) |
Process the body of a FastCGI parameter record.
Takes the body of a FastCGI record of type PARAMETER and parses it. You end up with a pointer/size for both the name and value of the parameter.
[in] | data | Pointer to the record body |
[out] | name | Reference to a pointer that will be pointed to the first byte of the parameter name |
[out] | nameSize | Reference to a value to will be given the size in bytes of the parameter name |
[out] | value | Reference to a pointer that will be pointed to the first byte of the parameter value |
[out] | valueSize | Reference to a value to will be given the size in bytes of the parameter value |
Definition at line 24 of file protocol.cpp.
References readBigEndian().
Referenced by Fastcgipp::Http::Session< charT >::fill(), and Fastcgipp::Manager< T >::localHandler().
T Fastcgipp::Protocol::readBigEndian | ( | T | value | ) | [inline] |
Read in a big endian value.
This function will read in a big endian value of type T. Should the system compiled for use big endian first, it simple returns the value passed to it. Should the system compiled for use little endian first, it will return a value with the endianess reversed.
value | Value with big endian first |
Definition at line 129 of file protocol.hpp.
Referenced by Fastcgipp::Protocol::Header::getContentLength(), Fastcgipp::Protocol::Header::getRequestId(), Fastcgipp::Protocol::BeginRequest::getRole(), processParamHeader(), Fastcgipp::Protocol::EndRequest::setAppStatus(), Fastcgipp::Protocol::Header::setContentLength(), and Fastcgipp::Protocol::Header::setRequestId().
const int Fastcgipp::Protocol::chunkSize = 8 |
All FastCGI records will be a multiple of this many bytes.
Definition at line 93 of file protocol.hpp.
Referenced by Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::emptyBuffer().
Reply record that will be sent when asked the maximum allowed file descriptors open at a time.
Referenced by Fastcgipp::Manager< T >::localHandler().
Reply record that will be sent when asked the maximum allowed requests at a time.
Referenced by Fastcgipp::Manager< T >::localHandler().
Reply record that will be sent when asked if requests can be multiplexed over a single connections.
Referenced by Fastcgipp::Manager< T >::localHandler().
char * Fastcgipp::Protocol::recordTypeLabels = { "INVALID", "BEGIN_REQUEST", "ABORT_REQUEST", "END_REQUEST", "PARAMS", "IN", "OUT", "ERR", "DATA", "GET_VALUES", "GET_VALUES_RESULT", "UNKNOWN_TYPE" } |
Defines text labels for the RecordType values.
Definition at line 49 of file protocol.cpp.
Referenced by Fastcgipp::Exceptions::RecordOutOfOrder::RecordOutOfOrder().
const int Fastcgipp::Protocol::version = 1 |
The version of the FastCGI protocol that this adheres to.
Definition at line 90 of file protocol.hpp.
Referenced by Fastcgipp::Request< charT >::complete(), Fastcgipp::Fcgistream< charT, traits >::Fcgibuf::emptyBuffer(), Fastcgipp::Request< charT >::handler(), Fastcgipp::Manager< T >::localHandler(), and Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH, PADDINGLENGTH >::ManagementReply().