CHttpServer::CallFunction
virtual int CallFunction( CHttpServerContext* pCtxt**, LPTSTR** pszQuery**, LPTSTR** pszCommand );
Return Value
A value of one of the following enum types:
Enum value | Description |
callOK | The function call was successful. |
callParamRequired | A required parameter was missing. |
callBadParamCount | There were too many or too few parameters. |
callBadCommand | The command name was not found. |
callNoStackSpace | No stack space was available. |
callNoStream | No CHtmlStream was available. |
callMissingQuote | A parameter had a bad format. |
callMissingParams | No parameters were available. |
callBadParam | A parameter had a bad format (i.e., only one quote). |
Parameters
pCtxt
Pointer to a CHttpServerContext object.
pszQuery
A pointer to a query. Specific to the type of command received from the client. See Remarks for more information.
pszCommand
Either a pointer to a query or NULL. Specific to the type of command received from the client. See Remarks for more information.
Remarks
Called by the framework to find and execute the appropriate function associated with the command in the URL.
Below is a breakdown between the types of methods received and the parameters:
Method type | pszQuery | pszCommand |
GET | A pointer to the EXTENSION_CONTROL_BLOCK structure query string. | NULL |
POST | A pointer to a query sent in the body of the command. | Pointer to the EXTENSION_CONTROL_BLOCK structure query string. |
Note Fill-out forms authors are advised to use only the POST method because of browser inconsistencies, and because GET methods are limited to a 1024-byte buffer. When writing forms for ISAPI, either use only the POST method, or design the ISA so that only the default function handles the form.
For example, some browsers sending a form via GET with an action of:
TestLet.DLL?Command
will truncate Command
and send:
TestLet.DLL?name=value
instead of the correct command:
TestLet.DLL?Command?name=value
By truncating Command
, the browser removes the association to the ISA function needed to map the request. Unless the function Command
is the default function, the form will not be handled correctly.
If you want to handle parsing of the EXTENSION_CONTROL_BLOCK structure function lpszQueryString yourself, override CallFunction and do not use the PARSE_MAP macros. See Internet Server API (ISAPI) Parse Maps for more information on using the parse map macros.
CHttpServer Overview | Class Members | Hierarchy Chart
See Also CHttpServerContext, Internet Server API (ISAPI) Parse Maps