Implements the HtmlPageHandler class as a function pointer callback for GET requests.
More...
#include <http.h>
Inherits HtmlPageHandler.
|
| virtual int | ProcessRaw (int sock, HTTP_Request &pdt) |
| | Pure virtual method that must be implemented to process HTTP requests.
|
| |
| | CallBackFunctionPageHandler (const char *pUrl, http_gethandlerfunc *pFunction, HTTP_RequestTypes reqType=tGet, int accessGroup=0, bool beforeFiles=false) |
| | Constructor for HTTP GET callback function.
|
| |
| | CallBackFunctionPageHandler (const char *pUrl, http_gethandlerfunc *pFunction, http_matchhandlerfunc *pMatchFunction, HTTP_RequestTypes reqType=tGet, int accessGroup=0, bool beforeFiles=false) |
| | Constructor for HTTP GET callback function, includes option for function to match the requested name.
|
| |
|
virtual bool | Match (HTTP_Request &req) |
| | Determines if this handler matches the incoming request.
|
| |
Public Member Functions inherited from HtmlPageHandler |
| | HtmlPageHandler (const char *url, HTTP_RequestTypes rt=tGet, int accessGroup=0, bool Before_Files=false) |
| | Constructs and registers an HTTP request handler for a specific URL pattern and method.
|
| |
|
| ~HtmlPageHandler () |
| | Destructor that automatically unregisters the handler from the global chain.
|
| |
| void | MoveHandlerToLast () |
| | Moves this handler to the end of the handler chain, making it function as a 404 handler.
|
| |
| int | GetGroup () |
| | Returns the access control group identifier for this handler.
|
| |
|
Static Public Member Functions inherited from HtmlPageHandler |
| static HtmlPageHandler * | FindHandler (HTTP_Request &req, bool bBeforeFiles) |
| | Locates the appropriate handler for an incoming HTTP request.
|
| |
Protected Member Functions inherited from HtmlPageHandler |
|
void | InsertSort (HtmlPageHandler *&ph) |
| | Inserts handler into sorted linked list based on priority.
|
| |
|
int | SortValue (HtmlPageHandler *pv) |
| | Compares handler priorities for sorting (-1, 0, 1)
|
| |
|
void | Remove () |
| | Removes handler from the linked list.
|
| |
Protected Attributes inherited from HtmlPageHandler |
|
HtmlPageHandler * | m_pNextHandler |
| | Pointer to next handler in the linked list for efficient traversal.
|
| |
|
const char * | m_pUrlName |
| | URL pattern to match. Empty string or NULL matches all requests.
|
| |
|
int | m_access_group |
| | Access control group identifier for authorization checks.
|
| |
|
HTTP_RequestTypes | m_requestTypes |
| | HTTP method types this handler responds to (GET, POST, etc.)
|
| |
Implements the HtmlPageHandler class as a function pointer callback for GET requests.
◆ CallBackFunctionPageHandler() [1/2]
Constructor for HTTP GET callback function.
- Parameters
-
| pUrl | Pointer to the URL to intercept from normal system processing |
| pFunction | Pointer to the function to call for the requested URL |
| reqType | Optional type of request to intercept, HTTP_RequestTypes. Default is tGet |
| accessGroup | Optional password group access level. Default is 0 = no password, maximum is 255. |
| beforeFiles | Optional parameter to specify a check for just a name, or the name of an actual file in the system. true = intercept before checking for a file of the same name false = check for any files of the requested name before intercepting |
◆ CallBackFunctionPageHandler() [2/2]
| CallBackFunctionPageHandler::CallBackFunctionPageHandler |
( |
const char * | pUrl, |
|
|
http_gethandlerfunc * | pFunction, |
|
|
http_matchhandlerfunc * | pMatchFunction, |
|
|
HTTP_RequestTypes | reqType = tGet, |
|
|
int | accessGroup = 0, |
|
|
bool | beforeFiles = false ) |
|
inline |
Constructor for HTTP GET callback function, includes option for function to match the requested name.
- Parameters
-
| pUrl | Pointer to the URL to intercept from normal system processing |
| pFunction | Pointer to the function to call for the requested URL |
| pMatchFunction | Pointer to function to perform the match check |
| reqType | Optional type of request to intercept, HTTP_RequestTypes. Default is tGet |
| accessGroup | Optional parameter to set a password group access level. Default is 0 = no password. |
| beforeFiles | Optional parameter to process a file name before checking for a compiled-in file of the same name. Default is false = check for any files of the requested name before intercepting |
◆ ProcessRaw()
| virtual int CallBackFunctionPageHandler::ProcessRaw |
( |
int | sock, |
|
|
HTTP_Request & | pd ) |
|
inlinevirtual |
Pure virtual method that must be implemented to process HTTP requests.
This method is called when a matching request is received and must contain the actual request processing logic. Implementations should read request data, perform necessary processing, and send appropriate HTTP responses.
- Parameters
-
| sock | Socket file descriptor for the client connection |
| pd | HTTP request object containing parsed request details (headers, URL, method, body data, etc.) |
- Returns
- Non-zero if the request was successfully processed and a response was sent, or 0 if the request was not processed (allows fallback to other handlers)
Implements HtmlPageHandler.
The documentation for this class was generated from the following file: