Symbols
loading...
Files
loading...
SummarySyntaxRelatedReferences

Fields

Field
Declared as
Description
Custom session closing callback. Called when a session is deleted, before freeing user and transport contexts and before closing the socket. This is a place for custom de-init code common to all sockets. The server will only close the socket if no custom session closing callback is set. If a custom callback is used, `close(sockfd)` should be called in here for most cases. Set the user or transport context to NULL if it was freed here, so the server does not try to free it again. This function is run for all terminated sessions, including sessions where the socket was closed by the network stack - that is, the file descriptor may not be valid anymore.
URI matcher function. Called when searching for a matching URI: 1) whose request handler is to be executed right after an HTTP request is successfully parsed 2) in order to prevent duplication while registering a new URI handler using `httpd_register_uri_handler()` Available options are: 1) NULL : Internally do basic matching using `strncmp()` 2) `httpd_uri_match_wildcard()` : URI wildcard matcher Users can implement their own matching functions (See description of the `httpd_uri_match_func_t` function prototype).
unsigned
Priority of FreeRTOS task which runs the server.
size_t
The maximum stack size allowed for the server task.
The core the HTTP server task will run on.
uint32_t
The memory capabilities to use when allocating the HTTP server task's stack.
uint16_t
TCP Port number for receiving and transmitting HTTP traffic.
uint16_t
UDP Port number for asynchronously exchanging control signals between various components of the server.
uint16_t
Max number of sockets/clients connected at any time (3 sockets are reserved for internal working of the HTTP server).
uint16_t
Maximum allowed uri handlers.
uint16_t
Maximum allowed additional headers in HTTP response.
uint16_t
Number of backlog connections.
bool
Purge "Least Recently Used" connection.
uint16_t
Timeout for recv function (in seconds).
uint16_t
Timeout for send function (in seconds).
void *
Global user context. This field can be used to store arbitrary user data within the server context. The value can be retrieved using the server handle, available e.g. in the httpd_req_t struct. When shutting down, the server frees up the user context by calling free() on the global_user_ctx field. If you wish to use a custom function for freeing the global user context, please specify that here.
Free function for global user context.
void *
Global transport context. Similar to global_user_ctx, but used for session encoding or encryption (e.g. to hold the SSL context). It will be freed using free(), unless global_transport_ctx_free_fn is specified.
Free function for global transport context.
bool
bool to enable/disable linger.
int
linger timeout (in seconds).
bool
Enable keep-alive timeout.
int
Keep-alive idle time. Default is 5 (second).
int
Keep-alive interval time. Default is 5 (second).
int
Keep-alive packet retry send count. Default is 3 counts.
Custom session opening callback. Called on a new session socket just after accept(), but before reading any data. This is an opportunity to set up e.g. SSL encryption using global_transport_ctx and the send/recv/pending session overrides. If a context needs to be maintained between these functions, store it in the session using httpd_sess_set_transport_ctx() and retrieve it later with httpd_sess_get_transport_ctx() Returning a value other than ESP_OK will immediately close the new socket.

References

from examples