Hello,

yet another spell fixes.

Ilya
From ce1dc66eeb1ab7e73426c0fa41dbb6e7655ce951 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <chipits...@gmail.com>
Date: Sat, 6 Aug 2022 23:01:00 +0500
Subject: [PATCH] CLEANUP: assorted typo fixes in the code and comments

This is 32nd iteration of typo fixes
---
 doc/design-thoughts/thread-group.txt |  6 +++---
 include/haproxy/quic_tp-t.h          |  2 +-
 include/haproxy/quic_tp.h            |  6 +++---
 include/import/ebmbtree.h            |  2 +-
 src/cfgparse-quic.c                  |  2 +-
 src/quic_tp.c                        | 24 ++++++++++++------------
 src/xprt_quic.c                      |  2 +-
 7 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/doc/design-thoughts/thread-group.txt b/doc/design-thoughts/thread-group.txt
index 9ab1f556d..e845230fa 100644
--- a/doc/design-thoughts/thread-group.txt
+++ b/doc/design-thoughts/thread-group.txt
@@ -339,18 +339,18 @@ fd_takeover():                                    |    do {
    old = {running, thread};                       |          return -1;
    new = {tid_bit, tid_bit};                      |       new = { running | tid_bit, old.thread }	 
    if (owner != expected) {                       |    } while (!dwcas({running, thread}, &old, &new));
-      atomic_and(runnning, ~tid_bit);             |
+      atomic_and(running, ~tid_bit);              |
       return -1; // fail                          | fd_clr_running():
    }                                              |    return atomic_and_fetch(running, ~tid_bit);
                                                   |
    while (old == {tid_bit, !=0 })                 | poll():
       if (dwcas({running, thread}, &old, &new)) { |    if (!owner)
-         atomic_and(runnning, ~tid_bit);          |       continue;
+         atomic_and(running, ~tid_bit);           |       continue;
          return 0; // success                     |
       }                                           |    if (!(thread_mask & tid_bit)) {
    }                                              |       epoll_ctl_del();
                                                   |       continue;
-   atomic_and(runnning, ~tid_bit);                |    }
+   atomic_and(running, ~tid_bit);                 |    }
    return -1; // fail                             |
                                                   |    // via fd_update_events()
 fd_delete():                                      |    if (fd_set_running() != -1) {
diff --git a/include/haproxy/quic_tp-t.h b/include/haproxy/quic_tp-t.h
index 77b05e32a..24859e73e 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 192460217..9ec559f84 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/include/import/ebmbtree.h b/include/import/ebmbtree.h
index 0e23539d1..b2dd1447a 100644
--- a/include/import/ebmbtree.h
+++ b/include/import/ebmbtree.h
@@ -111,7 +111,7 @@ static inline struct ebmb_node *ebmb_lookup_shorter(struct ebmb_node *start)
 	eb_troot_t *t = start->node.leaf_p;
 	struct ebmb_node *node;
 
-	/* first, chcek for duplicates */
+	/* first, check for duplicates */
 	node = ebmb_next_dup(start);
 	if (node)
 		return node;
diff --git a/src/cfgparse-quic.c b/src/cfgparse-quic.c
index 5268e9ada..a9ec0740a 100644
--- a/src/cfgparse-quic.c
+++ b/src/cfgparse-quic.c
@@ -22,7 +22,7 @@ static int bind_parse_quic_cc_algo(char **args, int cur_arg, struct proxy *px,
 	struct quic_cc_algo *cc_algo;
 
 	if (!*args[cur_arg + 1]) {
-		memprintf(err, "'%s' : missing control congestion algorith", args[cur_arg]);
+		memprintf(err, "'%s' : missing control congestion algorithm", args[cur_arg]);
 		return ERR_ALERT | ERR_FATAL;
 	}
 
diff --git a/src/quic_tp.c b/src/quic_tp.c
index f83ed8681..645149a5f 100644
--- a/src/quic_tp.c
+++ b/src/quic_tp.c
@@ -170,15 +170,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 */
@@ -415,20 +415,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))
@@ -437,11 +437,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);
@@ -459,7 +459,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;
@@ -565,7 +565,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;
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index b2431e158..f859979ad 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -4855,7 +4855,7 @@ static int quic_generate_retry_token_aad(unsigned char *aad,
 
 /* QUIC server only function.
  * Generate the token to be used in Retry packets. The token is written to
- * <buf> whith <len> as length. <odcid> is the original destination connection
+ * <buf> with <len> as length. <odcid> is the original destination connection
  * ID and <dcid> is our side destination connection ID (or client source
  * connection ID).
  * Returns the length of the encoded token or 0 on error.
-- 
2.37.1

Reply via email to