|
NetBurner 3.5.6
PDF Version |
HTTP Request Structure. More...
#include <http.h>
Public Member Functions | |
| void | ProcessLine (PSTR startofline) |
| internal function | |
| int | Respond (int socket) |
| internal function | |
| bool | ExtractAuthentication (char **pPassword, char **pUser) |
| used to extract user name and password in authentication test | |
| const char * | GetBoundaryMarker () |
| Extracts the boundary marker string from multipart Content-Type headers. | |
| int | ReadSimpleBody (int socket, const char *boundary=NULL) |
| Reads the HTTP request body from a socket into the internal buffer and processes termination conditions. | |
Public Attributes | |
| PSTR | pURL |
| Request URL. | |
| PSTR | pAuthorization |
| Authorization header if present, otherwise null. | |
| PSTR | pFirstCookie |
| First cookie if present, otherwise null. More may follow. | |
| PSTR | pData |
| Pointer to entire data set. Note: not null terminated. | |
| PSTR | pSep |
| Separator for multipart forms, null if not present. | |
| PSTR | pHost |
| Pointer to host record null if not present. | |
| PSTR | last_datarx |
| Pointer to last data read, internal use only. | |
| PSTR | wsKey |
| Web socket ket, internal use only. | |
| PSTR | wsProtocol |
| Web socket prototocl, internal use only. | |
| uint16_t | sep_len |
| Length of separator for multipart forms. | |
| uint32_t | content_length |
| Content length field from HTML header. | |
| uint32_t | rx_length |
| Total bytes receive from request, internal use only. | |
| IPADDR | client_IPaddr |
| IP address of client. | |
| uint8_t | websocketFlags |
| Web socket flags. | |
| HTTP_RequestTypes | req |
| Type of request HTTP_RequestTypes. | |
HTTP Request Structure.
This structure is populated before a HTTP request is sent out.
| const char * HTTP_Request::GetBoundaryMarker | ( | ) |
Extracts the boundary marker string from multipart Content-Type headers.
This function searches through the previously parsed HTTP headers to locate and extract the boundary parameter from the Content-Type header when multipart content is present. The boundary marker is used to delimit individual parts within multipart HTTP content such as multipart/form-data or multipart/mixed. The function parses the Content-Type header according to RFC specifications to isolate the boundary value from other Content-Type parameters.
| int HTTP_Request::ReadSimpleBody | ( | int | socket, |
| const char * | boundary = NULL ) |
Reads the HTTP request body from a socket into the internal buffer and processes termination conditions.
This function reads the remaining HTTP request body data from an established socket connection into the buffer backing the request object, preparing the pData member for access. The function handles different HTTP body termination scenarios including content-length bounded bodies, chunked transfer encoding, and boundary-delimited content such as multipart data. Reading continues until one of several termination conditions is met, allowing proper handling of various HTTP body formats.
| socket | File descriptor of the established HTTP connection Must be a valid socket with available data to read |
| boundary | Pointer to null-terminated string containing the boundary sequence that indicates the end of the request body (default: NULL) Used for multipart content or custom termination sequences If NULL, termination is determined by Content-Length or chunked encoding |
pData member for access. The socket must have HTTP headers already processed before calling this function. For multipart or boundary-terminated content, the boundary parameter must be specified. Buffer overflow conditions require additional reads to retrieve remaining data. The function respects HTTP protocol specifications for body termination.