From: Ilya Shipitsin Date: Tue, 1 Nov 2022 10:46:39 +0000 (+0500) Subject: CLEANUP: quic: replace "choosen" with "chosen" all over the code X-Git-Tag: v2.7-dev10~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ace3da8dd4052a03c95e7006734e9c1572c100b1;p=thirdparty%2Fhaproxy.git CLEANUP: quic: replace "choosen" with "chosen" all over the code Some variables were set as "choosen" instead of "chosen", this is dedicated spelling fix --- diff --git a/include/haproxy/quic_tp-t.h b/include/haproxy/quic_tp-t.h index 77b05e32a6..24859e73e6 100644 --- a/include/haproxy/quic_tp-t.h +++ b/include/haproxy/quic_tp-t.h @@ -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; diff --git a/include/haproxy/quic_tp.h b/include/haproxy/quic_tp.h index 85a7dd5573..18d568f387 100644 --- a/include/haproxy/quic_tp.h +++ b/include/haproxy/quic_tp.h @@ -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; diff --git a/src/quic_tp.c b/src/quic_tp.c index 485ca2deb2..50fca0cde8 100644 --- a/src/quic_tp.c +++ b/src/quic_tp.c @@ -173,15 +173,15 @@ static int quic_transport_param_dec_version_info(struct tp_version_information * const uint32_t *ver; /* 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 as choosen +/* Encode version information transport parameters with 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;