Struct esp_idf_sys::httpd_req
source · #[repr(C)]pub struct httpd_req {
pub handle: httpd_handle_t,
pub method: c_int,
pub uri: [c_char; 513],
pub content_len: usize,
pub aux: *mut c_void,
pub user_ctx: *mut c_void,
pub sess_ctx: *mut c_void,
pub free_ctx: httpd_free_ctx_fn_t,
pub ignore_sess_ctx_changes: bool,
}
Expand description
@brief HTTP Request Data Structure
Fields§
§handle: httpd_handle_t
< Handle to server instance
method: c_int
< The type of HTTP request, -1 if unsupported method
uri: [c_char; 513]
< The URI of this request (1 byte extra for null termination)
content_len: usize
< Length of the request body
aux: *mut c_void
< Internally used members
user_ctx: *mut c_void
User context pointer passed during URI registration.
sess_ctx: *mut c_void
Session Context Pointer
A session context. Contexts are maintained across ‘sessions’ for a given open TCP connection. One session could have multiple request responses. The web server will ensure that the context persists across all these request and responses.
By default, this is NULL. URI Handlers can set this to any meaningful value.
If the underlying socket gets closed, and this pointer is non-NULL, the web server will free up the context by calling free(), unless free_ctx function is set.
free_ctx: httpd_free_ctx_fn_t
Pointer to free context hook
Function to free session context
If the web server’s socket closes, it frees up the session context by calling free() on the sess_ctx member. If you wish to use a custom function for freeing the session context, please specify that here.
ignore_sess_ctx_changes: bool
Flag indicating if Session Context changes should be ignored
By default, if you change the sess_ctx in some URI handler, the http server will internally free the earlier context (if non NULL), after the URI handler returns. If you want to manage the allocation/reallocation/freeing of sess_ctx yourself, set this flag to true, so that the server will not perform any checks on it. The context will be cleared by the server (by calling free_ctx or free()) only if the socket gets closed.
Trait Implementations§
impl Copy for httpd_req
Auto Trait Implementations§
impl Freeze for httpd_req
impl RefUnwindSafe for httpd_req
impl !Send for httpd_req
impl !Sync for httpd_req
impl Unpin for httpd_req
impl UnwindSafe for httpd_req
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)