From b8888ab5577ea1dc604a0217a1e77ca60721d88e Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <chipitsine@gmail.com>
Date: Wed, 6 Jan 2021 21:20:16 +0500
Subject: [PATCH] CLEANUP: assorted typo fixes in the code and comments

This is 15th iteration of typo fixes
---
 include/haproxy/port_range.h |  2 +-
 src/auth.c                   |  2 +-
 src/cache.c                  | 10 +++++-----
 src/ev_poll.c                |  2 +-
 src/ev_select.c              |  2 +-
 src/fd.c                     |  2 +-
 src/hlua.c                   | 14 +++++++-------
 src/mux_h1.c                 |  4 ++--
 src/proto_quic.c             |  4 ++--
 src/stream.c                 |  4 ++--
 10 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/include/haproxy/port_range.h b/include/haproxy/port_range.h
index 8e7a937f5..c0d86591a 100644
--- a/include/haproxy/port_range.h
+++ b/include/haproxy/port_range.h
@@ -37,7 +37,7 @@ static inline int port_range_alloc_port(struct port_range *range)
 
 	get = _HA_ATOMIC_LOAD(&range->get);
 	do {
-		/* barrier ot make sure get is loaded before put */
+		/* barrier to make sure get is loaded before put */
 		__ha_barrier_atomic_load();
 		put = _HA_ATOMIC_LOAD(&range->put_t);
 		if (unlikely(put == get))
diff --git a/src/auth.c b/src/auth.c
index a3597d83c..5d74f7af4 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -49,7 +49,7 @@ __decl_thread(static HA_SPINLOCK_T auth_lock);
 #endif
 
 /* find targets for selected groups. The function returns pointer to
- * the userlist struct ot NULL if name is NULL/empty or unresolvable.
+ * the userlist struct or NULL if name is NULL/empty or unresolvable.
  */
 
 struct userlist *
diff --git a/src/cache.c b/src/cache.c
index 9485caa00..9267f5c64 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -713,7 +713,7 @@ cache_store_http_end(struct stream *s, struct filter *filter,
  /*
   * This intends to be used when checking HTTP headers for some
   * word=value directive. Return a pointer to the first character of value, if
-  * the word was not found or if there wasn't any value assigned ot it return NULL
+  * the word was not found or if there wasn't any value assigned or it return NULL
   */
 char *directive_value(const char *sample, int slen, const char *word, int wlen)
 {
@@ -965,7 +965,7 @@ static void set_secondary_key_encoding(struct htx *htx, char *secondary_key)
 		resp_encoding_bitmap |= VARY_ENCODING_IDENTITY;
 
 	/* Rewrite the bitmap part of the hash with the new bitmap that only
-	 * correponds the the response's encoding. */
+	 * corresponds the the response's encoding. */
 	write_u32(secondary_key + offset, resp_encoding_bitmap);
 }
 
@@ -2292,7 +2292,7 @@ static int accept_encoding_normalizer(struct htx *htx, struct ist hdr_name,
 	unsigned int encoding_value;
 	unsigned int rejected_encoding;
 
-	/* A user agent always accepts an unencoded value unless it explicitely
+	/* A user agent always accepts an unencoded value unless it explicitly
 	 * refuses it through an "identity;q=0" accept-encoding value. */
 	hash.encoding_bitmap |= VARY_ENCODING_IDENTITY;
 
@@ -2318,12 +2318,12 @@ static int accept_encoding_normalizer(struct htx *htx, struct ist hdr_name,
 	}
 
 	/* If a "*" was found in the accepted encodings (without a null weight),
-	 * all the encoding are accepted except the ones explicitely rejected. */
+	 * all the encoding are accepted except the ones explicitly rejected. */
 	if (hash.encoding_bitmap & VARY_ENCODING_STAR) {
 		hash.encoding_bitmap = ~0;
 	}
 
-	/* Clear explicitely rejected encodings from the bitmap */
+	/* Clear explicitly rejected encodings from the bitmap */
 	hash.encoding_bitmap &= encoding_bmp_bl;
 
 	/* As per RFC7231#5.3.4, "If no Accept-Encoding field is in the request,
diff --git a/src/ev_poll.c b/src/ev_poll.c
index b0b0e2bc4..f86be7691 100644
--- a/src/ev_poll.c
+++ b/src/ev_poll.c
@@ -132,7 +132,7 @@ static void _do_poll(struct poller *p, int exp, int wake)
 			break;
 		if (fdtab[fd].update_mask & tid_bit) {
 			/* Cheat a bit, as the state is global to all pollers
-			 * we don't need every thread ot take care of the
+			 * we don't need every thread or take care of the
 			 * update.
 			 */
 			_HA_ATOMIC_AND(&fdtab[fd].update_mask, ~all_threads_mask);
diff --git a/src/ev_select.c b/src/ev_select.c
index aca1ea8ec..dd0b762de 100644
--- a/src/ev_select.c
+++ b/src/ev_select.c
@@ -123,7 +123,7 @@ static void _do_poll(struct poller *p, int exp, int wake)
 			break;
 		if (fdtab[fd].update_mask & tid_bit) {
 			/* Cheat a bit, as the state is global to all pollers
-			 * we don't need every thread ot take care of the
+			 * we don't need every thread or take care of the
 			 * update.
 			 */
 			_HA_ATOMIC_AND(&fdtab[fd].update_mask, ~all_threads_mask);
diff --git a/src/fd.c b/src/fd.c
index 7cb864ec9..ccdefc676 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -165,7 +165,7 @@ redo_last:
 	}
 	__ha_barrier_store();
 	/* since we're alone at the end of the list and still locked(-2),
-	 * we know noone tried to add past us. Mark the end of list.
+	 * we know no one tried to add past us. Mark the end of list.
 	 */
 	_GET_PREV(fd, off) = last;
 	_GET_NEXT(fd, off) = -1;
diff --git a/src/hlua.c b/src/hlua.c
index ca07bb8a3..a52a1b50d 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -1706,7 +1706,7 @@ __LJMP static int hlua_map_new(struct lua_State *L)
 
 	/* load the map. */
 	if (!sample_load_map(args, &conv, file, line, &err)) {
-		/* error case: we cant use luaL_error because we must
+		/* error case: we can't use luaL_error because we must
 		 * free the err variable.
 		 */
 		luaL_where(L, 1);
@@ -1803,11 +1803,11 @@ static void hlua_socket_handler(struct appctx *appctx)
 		stream_shutdown(si_strm(si), SF_ERR_KILLED);
 	}
 
-	/* If we cant write, wakeup the pending write signals. */
+	/* If we can't write, wakeup the pending write signals. */
 	if (channel_output_closed(si_ic(si)))
 		notification_wake(&appctx->ctx.hlua_cosocket.wake_on_write);
 
-	/* If we cant read, wakeup the pending read signals. */
+	/* If we can't read, wakeup the pending read signals. */
 	if (channel_input_closed(si_oc(si)))
 		notification_wake(&appctx->ctx.hlua_cosocket.wake_on_read);
 
@@ -8589,7 +8589,7 @@ int hlua_post_init()
 	 *  - only the function_ref[0] set to -1 and all other positive
 	 * This ensure a same reference is not used both in shared
 	 * lua state and thread dedicated lua state. Note: is the case
-	 * reach, the shared state is prioritary, but the bug will be
+	 * reach, the shared state is priority, but the bug will be
 	 * complicated to found for the end user.
 	 */
 	errors = 0;
@@ -8609,8 +8609,8 @@ int hlua_post_init()
 		}
 
 		if ((fcn->function_ref[0] == -1) == (ret < 0)) {
-			ha_alert("Lua function '%s' is referenced both ins shared Lua context (throught lua-load) "
-			         "and per-thread Lua context (throught lua-load-per-thread). these two context "
+			ha_alert("Lua function '%s' is referenced both ins shared Lua context (through lua-load) "
+			         "and per-thread Lua context (through lua-load-per-thread). these two context "
 			         "exclusive.\n", fcn->name);
 			errors++;
 		}
@@ -8619,7 +8619,7 @@ int hlua_post_init()
 	if (errors > 0)
 		return 0;
 
-	/* after this point, this global wil no longer used, so set to
+	/* after this point, this global will no longer be used, so set to
 	 * -1 in order to have probably a segfault if someone use it
 	 */
 	hlua_state_id = -1;
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 3ed0001a7..75eb5f7fa 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -1125,11 +1125,11 @@ static void h1_adjust_case_outgoing_hdr(struct h1s *h1s, struct h1m *h1m, struct
 	if (eb_is_empty(&hdrs_map.map))
 		return;
 
-	/* No conversion fo the request headers */
+	/* No conversion for the request headers */
 	if (!(h1m->flags & H1_MF_RESP) && !(h1s->h1c->px->options2 & PR_O2_H1_ADJ_BUGSRV))
 		return;
 
-	/* No conversion fo the response headers */
+	/* No conversion for the response headers */
 	if ((h1m->flags & H1_MF_RESP) && !(h1s->h1c->px->options2 & PR_O2_H1_ADJ_BUGCLI))
 		return;
 
diff --git a/src/proto_quic.c b/src/proto_quic.c
index 8b3e91bb9..fa36ba707 100644
--- a/src/proto_quic.c
+++ b/src/proto_quic.c
@@ -574,7 +574,7 @@ static int quic_bind_listener(struct listener *listener, char *errmsg, int errle
 static void quic_enable_listener(struct listener *l)
 {
 	/* FIXME: The following statements are incorrect. This
-	 * is the responsability of the QUIC xprt to stop accepting new
+	 * is the responsibility of the QUIC xprt to stop accepting new
 	 * connections.
 	 */
 	if (fd_updt)
@@ -587,7 +587,7 @@ static void quic_enable_listener(struct listener *l)
 static void quic_disable_listener(struct listener *l)
 {
 	/* FIXME: The following statements are incorrect. This
-	 * is the responsability of the QUIC xprt to start accepting new
+	 * is the responsibility of the QUIC xprt to start accepting new
 	 * connections again.
 	 */
 	if (fd_updt)
diff --git a/src/stream.c b/src/stream.c
index e24ea49fc..5e675b192 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -2004,7 +2004,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state)
 	 */
 
 
-	/* If noone is interested in analysing data, it's time to forward
+	/* If no one is interested in analysing data, it's time to forward
 	 * everything. We configure the buffer to forward indefinitely.
 	 * Note that we're checking CF_SHUTR_NOW as an indication of a possible
 	 * recent call to channel_abort().
@@ -2175,7 +2175,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state)
 
 	/* perform output updates to the response buffer */
 
-	/* If noone is interested in analysing data, it's time to forward
+	/* If no one is interested in analysing data, it's time to forward
 	 * everything. We configure the buffer to forward indefinitely.
 	 * Note that we're checking CF_SHUTR_NOW as an indication of a possible
 	 * recent call to channel_abort().