esp_http_server: Provide apps an option to let http_server ignore sess_ctx changes

By default, if a URI handler changes the http session context,
the webserver internally clears the older context after the handler
returns. However, if applications want to change this behavior and
manage the allocation/de-allocation/freeing themselves and let the
server handle only the "socket close" case, this commit provides such
an option.
This commit is contained in:
Piyush Shah
2019-03-05 00:21:03 +05:30
parent dace2d6bc5
commit f28f4016cb
3 changed files with 20 additions and 4 deletions

View File

@@ -60,6 +60,7 @@ struct thread_data {
struct sock_db {
int fd; /*!< The file descriptor for this socket */
void *ctx; /*!< A custom context for this socket */
bool ignore_sess_ctx_changes; /*!< Flag indicating if session context changes should be ignored */
void *transport_ctx; /*!< A custom 'transport' context for this socket, to be used by send/recv/pending */
httpd_handle_t handle; /*!< Server handle */
httpd_free_ctx_fn_t free_ctx; /*!< Function for freeing the context */