NetBurner 3.3.8a
PDF Version
CallBackFunctionPageHandler Class Reference

Implements the HtmlPageHandler class as a function pointer callback for GET requests. More...

#include <http.h>

Inherits HtmlPageHandler.

Public Member Functions

virtual int ProcessRaw (int sock, HTTP_Request &pdt)
 This class will do a callback with data for each request to the specified url. More...
 
 CallBackFunctionPageHandler (const char *pUrl, http_gethandlerfunc *pFunction, HTTP_RequestTypes reqType=tGet, int accessGroup=0, bool beforeFiles=false)
 Constructor for HTTP GET callback function. More...
 
 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. More...
 
- Public Member Functions inherited from HtmlPageHandler
 HtmlPageHandler (const char *url, HTTP_RequestTypes rt=tGet, int accessGroup=0, bool Before_Files=false)
 Register handler. More...
 
int GetGroup ()
 Returns access group setting. More...
 

Additional Inherited Members

- Protected Member Functions inherited from HtmlPageHandler
void InsertSort (HtmlPageHandler *&ph)
 Insert sort.
 
int SortValue (HtmlPageHandler *pv)
 Returns the value of the sort compare: -1, 0, 1.
 
- Protected Attributes inherited from HtmlPageHandler
HtmlPageHandlerm_pNextHandler
 Pointer to next page handle object.
 
const char * m_pUrlName
 Pointer to URL. Performs a length match, an empty string matches everything.
 
int m_access_group
 The access group for this request see CheckHttpAccess.
 
HTTP_RequestTypes m_requestTypes
 Type of request, HTTP_RequestTypes.
 

Detailed Description

Implements the HtmlPageHandler class as a function pointer callback for GET requests.

Return values
0Not handled, no changes are made
1Handled
2TCP socket will be kept. Socket will get closed by some other method. For example, a large file could be sent from a different task. Any return value other than 2 means the page was processed normally.

Constructor & Destructor Documentation

◆ CallBackFunctionPageHandler() [1/2]

CallBackFunctionPageHandler::CallBackFunctionPageHandler ( const char *  pUrl,
http_gethandlerfunc *  pFunction,
HTTP_RequestTypes  reqType = tGet,
int  accessGroup = 0,
bool  beforeFiles = false 
)
inline

Constructor for HTTP GET callback function.

Parameters
pUrlPointer to the URL to intercept from normal system processing
pFunctionPointer to the function to call for the requested URL
reqTypeOptional type of request to intercept, HTTP_RequestTypes. Default is tGet
accessGroupOptional password group access level. Default is 0 = no password
beforeFilesOptional 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
Return values
1The callback function handled the request
2The callback handled the request, but will leave the socket open. This means some other part of your application must close the TCP socket to terminate the request.

◆ 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
pUrlPointer to the URL to intercept from normal system processing
pFunctionPointer to the function to call for the requested URL
pMatchFunctionPointer to function to perform the match check
reqTypeOptional type of request to intercept, HTTP_RequestTypes. Default is tGet
accessGroupOptional parameter to set a password group access level. Default is 0 = no password.
beforeFilesOptional 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
Return values
1The callback function handled the request
2The callback handled the request, but will leave the socket open. This means some other part of your application must close the TCP socket to terminate the request.

Member Function Documentation

◆ ProcessRaw()

virtual int CallBackFunctionPageHandler::ProcessRaw ( int  sock,
HTTP_Request pd 
)
inlinevirtual

This class will do a callback with data for each request to the specified url.

Returns
0 if the request was not processed.

Implements HtmlPageHandler.


The documentation for this class was generated from the following file: