Function esp_idf_hal::sys::httpd_sess_get_ctx
source · pub unsafe extern "C" fn httpd_sess_get_ctx(
handle: *mut c_void,
sockfd: i32,
) -> *mut c_void
Expand description
@brief Get session context from socket descriptor
Typically if a session context is created, it is available to URI handlers through the httpd_req_t structure. But, there are cases where the web server’s send/receive functions may require the context (for example, for accessing keying information etc). Since the send/receive function only have the socket descriptor at their disposal, this API provides them with a way to retrieve the session context.
@param[in] handle Handle to server returned by httpd_start @param[in] sockfd The socket descriptor for which the context should be extracted.
@return
- void* : Pointer to the context associated with this session
- NULL : Empty context / Invalid handle / Invalid socket fd