TCPIP_HTTP_GetExecute Function

C

HTTP_IO_RESULT TCPIP_HTTP_GetExecute(
    HTTP_CONN_HANDLE connHandle
);

Description

This function is implemented by the application developer. Its purpose is to parse the data received from URL parameters (GET method forms) and cookies and perform any application-specific tasks in response to these inputs. Any required authentication has already been validated.

When this function is called, the connection data buffer (see TCPIP_HTTP_CurrentConnectionDataBufferGet()) contains sequential name/value pairs of strings representing the data received. In this format, TCPIP_HTTP_ArgGet can be used to search for specific variables in the input. If data buffer space associated with this connection is required, connection data buffer may be overwritten here once the application is done with the values. Any data placed there will be available to future callbacks for this connection, including TCPIP_HTTP_PostExecute and any TCPIP_HTTP_Print_varname dynamic substitutions.

This function may also issue redirection by setting the connection data buffer to the destination file name or URL, and the connection httpStatus(TCPIP_HTTP_CurrentConnectionStatusSet()) to HTTP_REDIRECT.

Finally, this function may set cookies. Set connection data buffer to a series of name/value string pairs (in the same format in which parameters arrive) and then set the connection hasArgs (TCPIP_HTTP_CurrentConnectionHasArgsSet()) equal to the number of cookie name/value pairs. The cookies will be transmitted to the browser, and any future requests will have those values available in the connection data buffer.

Preconditions

None.

Parameters

ParametersDescription
connHandleHTTP connection handle.

Returns

  • HTTP_IO_DONE - Application is done processing.

  • HTTP_IO_NEED_DATA - This value may not be returned because more data will not become available.

  • HTTP_IO_WAITING - The application is waiting for an asynchronous process to complete, and this function should be called again later.

Remarks

This function is only called if variables are received via URL parameters or Cookie arguments. This function may NOT write to the TCP buffer. This function may service multiple HTTP requests simultaneously. Exercise caution when using global or static variables inside this routine. Use the connection callbackPos (TCPIP_HTTP_CurrentConnectionCallbackPosGet()) or the connection data buffer for storage associated with individual requests.