CLEANUP: quic: replace "choosen" with "chosen" all over the code
Some variables were set as "choosen" instead of "chosen", this is dedicated spelling fix
This commit is contained in:
parent
74b5f7b31b
commit
ace3da8dd4
@ -27,7 +27,7 @@ struct tp_preferred_address {
|
||||
};
|
||||
|
||||
struct tp_version_information {
|
||||
uint32_t choosen;
|
||||
uint32_t chosen;
|
||||
const uint32_t *others;
|
||||
size_t nb_others;
|
||||
const struct quic_version *negotiated_version;
|
||||
|
@ -13,7 +13,7 @@ void quic_transport_params_init(struct quic_transport_params *p, int server);
|
||||
int quic_transport_params_encode(unsigned char *buf,
|
||||
const unsigned char *end,
|
||||
struct quic_transport_params *p,
|
||||
const struct quic_version *choosen_version,
|
||||
const struct quic_version *chosen_version,
|
||||
int server);
|
||||
|
||||
int quic_transport_params_store(struct quic_conn *conn, int server,
|
||||
@ -46,10 +46,10 @@ static inline void quic_tp_cid_dump(struct buffer *buf,
|
||||
static inline void quic_tp_version_info_dump(struct buffer *b,
|
||||
const struct tp_version_information *tp, int local)
|
||||
{
|
||||
if (!tp->choosen)
|
||||
if (!tp->chosen)
|
||||
return;
|
||||
|
||||
chunk_appendf(b, "\n\tversion_information:(choosen=0x%08x", tp->choosen);
|
||||
chunk_appendf(b, "\n\tversion_information:(chosen=0x%08x", tp->chosen);
|
||||
if (tp->nb_others) {
|
||||
int i = 0;
|
||||
const uint32_t *ver;
|
||||
|
@ -173,15 +173,15 @@ static int quic_transport_param_dec_version_info(struct tp_version_information *
|
||||
const uint32_t *ver;
|
||||
|
||||
/* <tp_len> must be a multiple of sizeof(uint32_t) */
|
||||
if (tp_len < sizeof tp->choosen || (tp_len & 0x3))
|
||||
if (tp_len < sizeof tp->chosen || (tp_len & 0x3))
|
||||
return 0;
|
||||
|
||||
tp->choosen = ntohl(*(uint32_t *)*buf);
|
||||
tp->chosen = ntohl(*(uint32_t *)*buf);
|
||||
/* Must not be null */
|
||||
if (!tp->choosen)
|
||||
if (!tp->chosen)
|
||||
return 0;
|
||||
|
||||
*buf += sizeof tp->choosen;
|
||||
*buf += sizeof tp->chosen;
|
||||
tp->others = (const uint32_t *)*buf;
|
||||
|
||||
/* Others versions must not be null */
|
||||
@ -418,20 +418,20 @@ static int quic_transport_param_enc_pref_addr(unsigned char **buf,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Encode version information transport parameters with <choosen_version> as choosen
|
||||
/* Encode version information transport parameters with <chosen_version> as chosen
|
||||
* version.
|
||||
* Return 1 if succeeded, 0 if not.
|
||||
*/
|
||||
static int quic_transport_param_enc_version_info(unsigned char **buf,
|
||||
const unsigned char *end,
|
||||
const struct quic_version *choosen_version,
|
||||
const struct quic_version *chosen_version,
|
||||
int server)
|
||||
{
|
||||
int i;
|
||||
uint64_t tp_len;
|
||||
uint32_t ver;
|
||||
|
||||
tp_len = sizeof choosen_version->num + quic_versions_nb * sizeof(uint32_t);
|
||||
tp_len = sizeof chosen_version->num + quic_versions_nb * sizeof(uint32_t);
|
||||
if (!quic_transport_param_encode_type_len(buf, end,
|
||||
QUIC_TP_DRAFT_VERSION_INFORMATION,
|
||||
tp_len))
|
||||
@ -440,11 +440,11 @@ static int quic_transport_param_enc_version_info(unsigned char **buf,
|
||||
if (end - *buf < tp_len)
|
||||
return 0;
|
||||
|
||||
/* First: choosen version */
|
||||
ver = htonl(choosen_version->num);
|
||||
/* First: chosen version */
|
||||
ver = htonl(chosen_version->num);
|
||||
memcpy(*buf, &ver, sizeof ver);
|
||||
*buf += sizeof ver;
|
||||
/* For servers: all supported version, choosen included */
|
||||
/* For servers: all supported version, chosen included */
|
||||
for (i = 0; i < quic_versions_nb; i++) {
|
||||
ver = htonl(quic_versions[i].num);
|
||||
memcpy(*buf, &ver, sizeof ver);
|
||||
@ -462,7 +462,7 @@ static int quic_transport_param_enc_version_info(unsigned char **buf,
|
||||
int quic_transport_params_encode(unsigned char *buf,
|
||||
const unsigned char *end,
|
||||
struct quic_transport_params *p,
|
||||
const struct quic_version *choosen_version,
|
||||
const struct quic_version *chosen_version,
|
||||
int server)
|
||||
{
|
||||
unsigned char *head;
|
||||
@ -568,7 +568,7 @@ int quic_transport_params_encode(unsigned char *buf,
|
||||
p->active_connection_id_limit))
|
||||
return 0;
|
||||
|
||||
if (!quic_transport_param_enc_version_info(&pos, end, choosen_version, server))
|
||||
if (!quic_transport_param_enc_version_info(&pos, end, chosen_version, server))
|
||||
return 0;
|
||||
|
||||
return pos - head;
|
||||
|
Loading…
x
Reference in New Issue
Block a user