pub type s2n_cache_retrieve_callback = Option<unsafe extern "C" fn(conn: *mut s2n_connection, arg1: *mut c_void, key: *const c_void, key_size: u64, value: *mut c_void, value_size: *mut u64) -> c_int>;
Expand description

Cache callback function that allows the caller to retrieve SSL session data from a cache.

The callback function takes six arguments: a pointer to the s2n_connection object, a pointer to arbitrary data for use within the callback, a pointer to a key which can be used to retrieve the cached entry, a 64 bit unsigned integer specifying the size of this key, a pointer to a memory location where the value should be stored, and a pointer to a 64 bit unsigned integer specifying the size of this value.

Initially *value_size will be set to the amount of space allocated for the value, the callback should set *value_size to the actual size of the data returned. If there is insufficient space, -1 should be returned. If the cache is not ready to provide data for the request, S2N_CALLBACK_BLOCKED should be returned.

This will cause s2n_negotiate() to return S2N_BLOCKED_ON_APPLICATION_INPUT.