/
On Transaction Complete Hook
On Transaction Complete Hook
This hook function, if defined, is called every time a HTTP transaction is completed to notify the upper application to release resource allocated related to a transaction, as shown in the figure Hook Functions..
Prototype
void HTTPs_TransCompleteHook (const HTTPs_INSTANCE *p_instance, HTTPs_CONN *p_conn, const void *p_hook_cfg);
Arguments
p_instance
Pointer to the instance structure (read only).
p_conn
Pointer to the connection structure.
p_hook_cfg
Pointer to hook application data.
Return Values
None.
Required Configuration
See section Hook Configuration.
Notes / Warnings
- The instance structure is for read-only. It must not be modified.
- The connection structure is read-only since the connection will be freed after this call.
ConnDataPtr
parameter should be used to store the location of the data allocated.
Example Template
The listing below is shown to demonstrate the µC/HTTP-server module capabilities. That code simply print that the HTTP transaction is completed. The hook will be usually used to release objects allocated for the duration of an HTTP transaction.
Listing - Transaction Complete Hook Example Code
static void HTTPs_TransCompleteHook (const HTTPs_INSTANCE *p_instance, HTTPs_CONN *p_conn, const void *p_hook_cfg) { printf("HTTP transaction is completed.\n\r"); }
Related content
On Transaction Complete
On Transaction Complete
More like this
Connection Close
Connection Close
More like this
On Request Body Received Hook
On Request Body Received Hook
More like this
On Connection Connect
On Connection Connect
More like this
CGI Post
CGI Post
More like this
Hook Configuration
Hook Configuration
More like this