rustls_session_store_get_callback

Prototype of a callback that can be installed by the application at the rustls_server_config or rustls_client_config. This callback will be invoked by a TLS session when looking up the data for a TLS session id. userdata will be supplied based on rustls_{client,server}_session_set_userdata.

The buf points to count consecutive bytes where the callback is expected to copy the result to. The number of copied bytes needs to be written to out_n. The callback should not read any data from buf.

If the value to copy is larger than count, the callback should never do a partial copy but instead remove the value from its store and act as if it was never found.

The callback should return RUSTLS_RESULT_OK to indicate that a value was retrieved and written in its entirety into buf, or RUSTLS_RESULT_NOT_FOUND if no session was retrieved.

When remove_after is != 0, the returned data needs to be removed from the store.

NOTE: the passed in key and buf are only available during the callback invocation. NOTE: callbacks used in several sessions via a common config must be implemented thread-safe.

extern (C)
alias rustls_session_store_get_callback = uint function

Meta