dwnx_ccerr_set_liberr

Synopsis

#include <dwnx/dwnx.h>

void dwnx_ccerr_set_liberr(dwnx_ccerr *ccerr, int liberr, const uint8_t *reason, size_t reasonlen)

dwnx_ccerr_set_liberr() sets type and error_code based on liberr.

reason is the reason phrase of length reasonlen. This function does not make a copy of the reason phrase.

If liberr is DWNX_ERR_IDLE_CLOSE, ccerr->type is set to dwnx_ccerr_type.DWNX_CCERR_TYPE_IDLE_CLOSE, and ccerr->error_code to DWNX_NO_ERROR.

Otherwise, ccerr->type is set to dwnx_ccerr_type.DWNX_CCERR_TYPE_TRANSPORT, and ccerr->error_code is set to an error code inferred by liberr (see dwnx_err_infer_quic_transport_error_code()).