ngtcp2_connection_close_error_set_transport_error_liberr
Synopsis
#include <ngtcp2/ngtcp2.h>
-
void ngtcp2_connection_close_error_set_transport_error_liberr(ngtcp2_connection_close_error *ccerr, int liberr, const uint8_t *reason, size_t reasonlen)
ngtcp2_connection_close_error_set_transport_error_liberr()
sets type and error_code based on liberr.If liberr is
NGTCP2_ERR_RECV_VERSION_NEGOTIATION
,ccerr->type
is set tongtcp2_connection_close_error_code_type.NGTCP2_CONNECTION_CLOSE_ERROR_CODE_TYPE_TRANSPORT_VERSION_NEGOTIATION
, andccerr->error_code
toNGTCP2_NO_ERROR
. If liberr isNGTCP2_ERR_IDLE_CLOSE
,ccerr->type
is set tongtcp2_connection_close_error_code_type.NGTCP2_CONNECTION_CLOSE_ERROR_CODE_TYPE_TRANSPORT_IDLE_CLOSE
, andccerr->error_code
toNGTCP2_NO_ERROR
. Otherwise,ccerr->type
is set tongtcp2_connection_close_error_code_type.NGTCP2_CONNECTION_CLOSE_ERROR_CODE_TYPE_TRANSPORT
, andccerr->error_code
is set to an error code inferred by liberr (seengtcp2_err_infer_quic_transport_error_code()
). reason is the reason phrase of length reasonlen. This function does not make a copy of the reason phrase.