pub type httpd_recv_func_t = Option<unsafe extern "C" fn(hd: httpd_handle_t, sockfd: c_int, buf: *mut c_char, buf_len: usize, flags: c_int) -> c_int>;
Expand description

@brief Prototype for HTTPDs low-level recv function

@note User specified recv function must handle errors internally, depending upon the set value of errno, and return specific HTTPD_SOCK_ERR_ codes, which will eventually be conveyed as return value of httpd_req_recv() function

@param[in] hd server instance @param[in] sockfd session socket file descriptor @param[in] buf buffer with bytes to send @param[in] buf_len data size @param[in] flags flags for the send() function @return

  • Bytes : The number of bytes received successfully
  • 0 : Buffer length parameter is zero / connection closed by peer
  • HTTPD_SOCK_ERR_INVALID : Invalid arguments
  • HTTPD_SOCK_ERR_TIMEOUT : Timeout/interrupted while calling socket recv()
  • HTTPD_SOCK_ERR_FAIL : Unrecoverable error while calling socket recv()

Aliased Type§

enum httpd_recv_func_t {
    None,
    Some(unsafe extern "C" fn(_: *mut c_void, _: i32, _: *mut i8, _: usize, _: i32) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut c_void, _: i32, _: *mut i8, _: usize, _: i32) -> i32)

Some value of type T.