ngtcp2_ccerr_set_liberr
Synopsis
#include <ngtcp2/ngtcp2.h>
-
void ngtcp2_ccerr_set_liberr(ngtcp2_ccerr *ccerr, int liberr, const uint8_t *reason, size_t reasonlen)
ngtcp2_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
NGTCP2_ERR_RECV_VERSION_NEGOTIATION,ccerr->typeis set tongtcp2_ccerr_type.NGTCP2_CCERR_TYPE_VERSION_NEGOTIATION, andccerr->error_codetoNGTCP2_NO_ERROR.If liberr is
NGTCP2_ERR_IDLE_CLOSE,ccerr->typeis set tongtcp2_ccerr_type.NGTCP2_CCERR_TYPE_IDLE_CLOSE, andccerr->error_codetoNGTCP2_NO_ERROR.If liberr is
NGTCP2_ERR_DROP_CONN,ccerr->typeis set tongtcp2_ccerr_type.NGTCP2_CCERR_TYPE_DROP_CONN, andccerr->error_codetoNGTCP2_NO_ERROR.If liberr is
NGTCP2_ERR_RETRY,ccerr->typeis set tongtcp2_ccerr_type.NGTCP2_CCERR_TYPE_RETRY, andccerr->error_typetoNGTCP2_NO_ERROR.Otherwise,
ccerr->typeis set tongtcp2_ccerr_type.NGTCP2_CCERR_TYPE_TRANSPORT, andccerr->error_codeis set to an error code inferred by liberr (seengtcp2_err_infer_quic_transport_error_code()).