|
fastcgi++
A C++ FastCGI/Web API
|
Data structure of HTTP environment data. More...
#include <fastcgi++/http.hpp>
Public Member Functions | |
| void | fill (const char *data, const char *dataEnd) |
| Parses FastCGI parameter data into the data structure. More... | |
| void | fillPostBuffer (const char *start, const char *end) |
| Consolidates POST data into a single buffer. More... | |
| bool | parsePostBuffer () |
| Attempts to parse the POST buffer. More... | |
| const std::vector< char > & | postBuffer () const |
| Get the post buffer. More... | |
| void | clearPostBuffer () |
| Clear the post buffer. More... | |
| Environment () | |
Public Attributes | |
| std::basic_string< charT > | host |
| Hostname of the server. More... | |
| std::basic_string< charT > | userAgent |
| User agent string. More... | |
| std::basic_string< charT > | acceptContentTypes |
| Content types the client accepts. More... | |
| std::vector< std::string > | acceptLanguages |
| Languages the client accepts. More... | |
| std::basic_string< charT > | acceptCharsets |
| Character sets the clients accepts. More... | |
| std::basic_string< charT > | authorization |
| Http authorization string. More... | |
| std::basic_string< charT > | referer |
| Referral URL. More... | |
| std::basic_string< charT > | contentType |
| Content type of data sent from client. More... | |
| std::basic_string< charT > | root |
| HTTP root directory. More... | |
| std::basic_string< charT > | scriptName |
| Filename of script relative to the HTTP root directory. More... | |
| RequestMethod | requestMethod |
| REQUEST_METHOD. More... | |
| std::basic_string< charT > | requestUri |
| REQUEST_URI. More... | |
| std::vector< std::basic_string< charT > > | pathInfo |
| Path information. More... | |
| unsigned | etag |
| The etag the client assumes this document should have. More... | |
| unsigned | keepAlive |
| How many seconds the connection should be kept alive. More... | |
| unsigned | contentLength |
| Length of content to be received from the client (post data) More... | |
| Address | serverAddress |
| IP address of the server. More... | |
| Address | remoteAddress |
| IP address of the client. More... | |
| uint16_t | serverPort |
| TCP port used by the server. More... | |
| uint16_t | remotePort |
| TCP port used by the client. More... | |
| std::time_t | ifModifiedSince |
| Timestamp the client has for this document. More... | |
| std::multimap< std::basic_string< charT >, std::basic_string< charT > > | cookies |
| Container with all url-encoded cookie data. More... | |
| std::multimap< std::basic_string< charT >, std::basic_string< charT > > | gets |
| Container with all url-encoded GET data. More... | |
| std::multimap< std::basic_string< charT >, std::basic_string< charT > > | posts |
| Container of none-file POST data. More... | |
| std::multimap< std::basic_string< charT >, File< charT > > | files |
| Container of file POST data. More... | |
Private Member Functions | |
| void | parsePostsMultipart () |
| Parses "multipart/form-data" http post data. More... | |
| void | parsePostsUrlEncoded () |
| Parses "application/x-www-form-urlencoded" post data. More... | |
Private Attributes | |
| std::vector< char > | boundary |
| Raw string of characters representing the post boundary. More... | |
| std::vector< char > | m_postBuffer |
| Buffer for processing post data. More... | |
Data structure of HTTP environment data.
This structure contains all HTTP environment data for each individual request. The data is processed from FastCGI parameter records.
| charT | Character type to use for strings |
|
inline |
|
inline |
Clear the post buffer.
Definition at line 379 of file http.hpp.
References Fastcgipp::Http::Environment< charT >::m_postBuffer.
| void Fastcgipp::Http::Environment< charT >::fill | ( | const char * | data, |
| const char * | dataEnd | ||
| ) |
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 | Start of parameter data |
| [in] | dataEnd | 1+ the last byte of parameter data |
Definition at line 166 of file http.cpp.
References Fastcgipp::Http::atoi(), Fastcgipp::Http::decodeUrlEncoded(), Fastcgipp::Logging::ERROR, Fastcgipp::Http::percentEscapedToRealBytes(), Fastcgipp::Protocol::processParamHeader(), Fastcgipp::Http::requestMethodLabels, and Fastcgipp::Http::vecToString().
| void Fastcgipp::Http::Environment< charT >::fillPostBuffer | ( | const char * | start, |
| const char * | end | ||
| ) |
| bool Fastcgipp::Http::Environment< charT >::parsePostBuffer | ( | ) |
|
inlineprivate |
Parses "multipart/form-data" http post data.
Definition at line 441 of file http.cpp.
References Fastcgipp::Http::File< charT >::contentType, Fastcgipp::Http::File< charT >::data, Fastcgipp::Http::File< charT >::filename, Fastcgipp::Http::File< charT >::size, and Fastcgipp::Http::vecToString().
|
inlineprivate |
Parses "application/x-www-form-urlencoded" post data.
Definition at line 618 of file http.cpp.
References Fastcgipp::Http::decodeUrlEncoded().
|
inline |
Get the post buffer.
Definition at line 373 of file http.hpp.
References Fastcgipp::Http::Environment< charT >::m_postBuffer.
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::acceptCharsets |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::acceptContentTypes |
| std::vector<std::string> Fastcgipp::Http::Environment< charT >::acceptLanguages |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::authorization |
|
private |
| unsigned Fastcgipp::Http::Environment< charT >::contentLength |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::contentType |
| std::multimap< std::basic_string<charT>, std::basic_string<charT> > Fastcgipp::Http::Environment< charT >::cookies |
| unsigned Fastcgipp::Http::Environment< charT >::etag |
| std::multimap< std::basic_string<charT>, File<charT> > Fastcgipp::Http::Environment< charT >::files |
| std::multimap< std::basic_string<charT>, std::basic_string<charT> > Fastcgipp::Http::Environment< charT >::gets |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::host |
| std::time_t Fastcgipp::Http::Environment< charT >::ifModifiedSince |
| unsigned Fastcgipp::Http::Environment< charT >::keepAlive |
|
private |
Buffer for processing post data.
Definition at line 405 of file http.hpp.
Referenced by Fastcgipp::Http::Environment< charT >::clearPostBuffer(), and Fastcgipp::Http::Environment< charT >::postBuffer().
| std::vector<std::basic_string<charT> > Fastcgipp::Http::Environment< charT >::pathInfo |
| std::multimap< std::basic_string<charT>, std::basic_string<charT> > Fastcgipp::Http::Environment< charT >::posts |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::referer |
| Address Fastcgipp::Http::Environment< charT >::remoteAddress |
| uint16_t Fastcgipp::Http::Environment< charT >::remotePort |
| RequestMethod Fastcgipp::Http::Environment< charT >::requestMethod |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::requestUri |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::root |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::scriptName |
| Address Fastcgipp::Http::Environment< charT >::serverAddress |
| uint16_t Fastcgipp::Http::Environment< charT >::serverPort |
| std::basic_string<charT> Fastcgipp::Http::Environment< charT >::userAgent |
1.8.14