#include <http.hpp>
Public Types | |
typedef std::map < std::basic_string< charT > , Post< charT > > | Posts |
Public Member Functions | |
bool | fill (const char *data, size_t size) |
Parses FastCGI parameter data into the data structure. | |
void | fillPosts (const char *data, size_t size) |
Parses raw http post data into the posts object. | |
void | clearPostBuffer () |
Clear the post buffer. | |
Public Attributes | |
std::basic_string< charT > | host |
Hostname of the server. | |
std::basic_string< charT > | userAgent |
User agent string. | |
std::basic_string< charT > | acceptContentTypes |
Content types the client accepts. | |
std::basic_string< charT > | acceptLanguages |
Languages the client accepts. | |
std::basic_string< charT > | acceptCharsets |
Character sets the clients accepts. | |
std::basic_string< charT > | referer |
Referral URL. Percent symbol escaped bytes are converted to their actual value. | |
std::basic_string< charT > | contentType |
Content type of data sent from client. | |
std::basic_string< charT > | queryString |
Query string appended to the URL submitted by the client. Percent symbol escaped bytes are converted to their actual value. | |
std::basic_string< charT > | cookies |
Cookie string sent from the client. | |
std::basic_string< charT > | root |
HTTP root directory. | |
std::basic_string< charT > | scriptName |
Filename of script relative to the HTTP root directory. | |
int | etag |
The etag the client assumes this document should have. | |
int | keepAlive |
How many seconds the connection should be kept alive. | |
unsigned int | contentLength |
Length of content to be received from the client (post data). | |
Address | serverAddress |
IP address of the server. | |
Address | remoteAddress |
IP address of the client. | |
uint16_t | serverPort |
TCP port used by the server. | |
uint16_t | remotePort |
TCP port used by the client. | |
boost::posix_time::ptime | ifModifiedSince |
Timestamp the client has for this document. | |
Posts | posts |
STL container associating Post objects with their name. | |
Private Attributes | |
boost::scoped_array< char > | boundary |
Raw string of characters representing the post boundary. | |
size_t | boundarySize |
Size of boundary. | |
boost::scoped_array< char > | postBuffer |
Buffer for processing post data. | |
size_t | postBufferSize |
Size of data in postBuffer. |
This structure contains all HTTP session data for each individual request. The data is processed from FastCGI parameter records.
charT | Character type to use for strings |
Definition at line 175 of file http.hpp.
typedef std::map<std::basic_string<charT>, Post<charT> > Fastcgipp::Http::Session< charT >::Posts |
void Fastcgipp::Http::Session< charT >::clearPostBuffer | ( | ) | [inline] |
Clear the post buffer.
Definition at line 246 of file http.hpp.
References Fastcgipp::Http::Session< charT >::postBuffer, and Fastcgipp::Http::Session< charT >::postBufferSize.
bool Fastcgipp::Http::Session< charT >::fill | ( | const char * | data, | |
size_t | size | |||
) | [inline] |
Parses FastCGI parameter data into the data structure.
This function will take the body of a FastCGI parameter record and parse the data into the data structure. data should equal the first character of the records body with size being it's content length.
[in] | data | Pointer to the first byte of parameter data |
[in] | size | Size of data in bytes |
Definition at line 253 of file http.cpp.
References Fastcgipp::Http::Session< charT >::acceptCharsets, Fastcgipp::Http::Session< charT >::acceptContentTypes, Fastcgipp::Http::Session< charT >::acceptLanguages, Fastcgipp::Http::Address::assign(), Fastcgipp::Http::atoi(), Fastcgipp::Http::Session< charT >::boundary, Fastcgipp::Http::Session< charT >::boundarySize, Fastcgipp::Http::charToString(), Fastcgipp::Http::Session< charT >::contentLength, Fastcgipp::Http::Session< charT >::contentType, Fastcgipp::Http::Session< charT >::cookies, Fastcgipp::Http::Session< charT >::etag, Fastcgipp::Http::Session< charT >::host, Fastcgipp::Http::Session< charT >::ifModifiedSince, Fastcgipp::Http::Session< charT >::keepAlive, Fastcgipp::Http::percentEscapedToRealBytes(), Fastcgipp::Protocol::processParamHeader(), Fastcgipp::Http::Session< charT >::queryString, Fastcgipp::Http::Session< charT >::referer, Fastcgipp::Http::Session< charT >::remoteAddress, Fastcgipp::Http::Session< charT >::remotePort, Fastcgipp::Http::Session< charT >::root, Fastcgipp::Http::Session< charT >::scriptName, Fastcgipp::Http::Session< charT >::serverAddress, Fastcgipp::Http::Session< charT >::serverPort, and Fastcgipp::Http::Session< charT >::userAgent.
void Fastcgipp::Http::Session< charT >::fillPosts | ( | const char * | data, | |
size_t | size | |||
) | [inline] |
Parses raw http post data into the posts object.
This function will take arbitrarily divided chunks of raw http post data and parse them into the posts container of Post objects. data should equal the first bytes of the FastCGI IN records body with size being it's content length.
[in] | data | Pointer to the first byte of post data |
[in] | size | Size of data in bytes |
Definition at line 346 of file http.cpp.
References Fastcgipp::Http::Session< charT >::boundary, Fastcgipp::Http::Session< charT >::boundarySize, Fastcgipp::Http::charToString(), Fastcgipp::Http::Post< charT >::data, Fastcgipp::Http::parseXmlValue(), Fastcgipp::Http::Session< charT >::postBuffer, Fastcgipp::Http::Session< charT >::postBufferSize, Fastcgipp::Http::Session< charT >::posts, Fastcgipp::Http::Post< charT >::size, Fastcgipp::Http::Post< charT >::type, and Fastcgipp::Http::Post< charT >::value.
std::basic_string<charT> Fastcgipp::Http::Session< charT >::acceptCharsets |
Character sets the clients accepts.
Definition at line 186 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::acceptContentTypes |
Content types the client accepts.
Definition at line 182 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::acceptLanguages |
Languages the client accepts.
Definition at line 184 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
boost::scoped_array<char> Fastcgipp::Http::Session< charT >::boundary [private] |
Raw string of characters representing the post boundary.
Definition at line 250 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill(), and Fastcgipp::Http::Session< charT >::fillPosts().
size_t Fastcgipp::Http::Session< charT >::boundarySize [private] |
Size of boundary.
Definition at line 252 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill(), and Fastcgipp::Http::Session< charT >::fillPosts().
unsigned int Fastcgipp::Http::Session< charT >::contentLength |
Length of content to be received from the client (post data).
Definition at line 204 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::contentType |
Content type of data sent from client.
Definition at line 190 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::cookies |
Cookie string sent from the client.
Definition at line 194 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
int Fastcgipp::Http::Session< charT >::etag |
The etag the client assumes this document should have.
Definition at line 200 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::host |
Hostname of the server.
Definition at line 178 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
boost::posix_time::ptime Fastcgipp::Http::Session< charT >::ifModifiedSince |
Timestamp the client has for this document.
Definition at line 214 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
int Fastcgipp::Http::Session< charT >::keepAlive |
How many seconds the connection should be kept alive.
Definition at line 202 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
boost::scoped_array<char> Fastcgipp::Http::Session< charT >::postBuffer [private] |
Buffer for processing post data.
Definition at line 255 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::clearPostBuffer(), and Fastcgipp::Http::Session< charT >::fillPosts().
size_t Fastcgipp::Http::Session< charT >::postBufferSize [private] |
Size of data in postBuffer.
Definition at line 257 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::clearPostBuffer(), and Fastcgipp::Http::Session< charT >::fillPosts().
Posts Fastcgipp::Http::Session< charT >::posts |
STL container associating Post objects with their name.
Definition at line 221 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fillPosts().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::queryString |
Query string appended to the URL submitted by the client. Percent symbol escaped bytes are converted to their actual value.
Definition at line 192 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::referer |
Referral URL. Percent symbol escaped bytes are converted to their actual value.
Definition at line 188 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
Address Fastcgipp::Http::Session< charT >::remoteAddress |
IP address of the client.
Definition at line 208 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
uint16_t Fastcgipp::Http::Session< charT >::remotePort |
TCP port used by the client.
Definition at line 212 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::root |
HTTP root directory.
Definition at line 196 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::scriptName |
Filename of script relative to the HTTP root directory.
Definition at line 198 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
Address Fastcgipp::Http::Session< charT >::serverAddress |
IP address of the server.
Definition at line 206 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
uint16_t Fastcgipp::Http::Session< charT >::serverPort |
TCP port used by the server.
Definition at line 210 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().
std::basic_string<charT> Fastcgipp::Http::Session< charT >::userAgent |
User agent string.
Definition at line 180 of file http.hpp.
Referenced by Fastcgipp::Http::Session< charT >::fill().