CLEANUP: assorted typo fixes in the code and comments

These are mostly comments in the code. A few error messages were fixed
and are of low enough importance not to deserve a backport. Some regtests
were also fixed.
diff --git a/include/common/defaults.h b/include/common/defaults.h
index e86c9bc..43d287d 100644
--- a/include/common/defaults.h
+++ b/include/common/defaults.h
@@ -111,7 +111,7 @@
 #define MAX_SESS_STKCTR 3
 #endif
 
-// max # of extra stick-table data types that can be registred at runtime
+// max # of extra stick-table data types that can be registered at runtime
 #ifndef STKTABLE_EXTRA_DATA_TYPES
 #define STKTABLE_EXTRA_DATA_TYPES 0
 #endif
@@ -153,14 +153,14 @@
 #define RUNQUEUE_DEPTH 200
 #endif
 
-// cookie delimitor in "prefix" mode. This character is inserted between the
+// cookie delimiter in "prefix" mode. This character is inserted between the
 // persistence cookie and the original value. The '~' is allowed by RFC6265,
 // and should not be too common in server names.
 #ifndef COOKIE_DELIM
 #define COOKIE_DELIM    '~'
 #endif
 
-// this delimitor is used between a server's name and a last visit date in
+// this delimiter is used between a server's name and a last visit date in
 // cookies exchanged with the client.
 #ifndef COOKIE_DELIM_DATE
 #define COOKIE_DELIM_DATE       '|'
diff --git a/include/common/h1.h b/include/common/h1.h
index 5ed26fa..fc28b48 100644
--- a/include/common/h1.h
+++ b/include/common/h1.h
@@ -196,7 +196,7 @@
  * returns the number of bytes parsed on success, so the caller can set msg_state
  * to HTTP_MSG_CHUNK_SIZE. If not enough data are available, the function does not
  * change anything and returns zero. Otherwise it returns a negative value
- * indicating the error positionn relative to <stop>. Note: this function is
+ * indicating the error position relative to <stop>. Note: this function is
  * designed to parse wrapped CRLF at the end of the buffer.
  */
 static inline int h1_skip_chunk_crlf(const struct buffer *buf, int start, int stop)
diff --git a/include/common/hpack-tbl.h b/include/common/hpack-tbl.h
index ca3f2aa..bb1ac06 100644
--- a/include/common/hpack-tbl.h
+++ b/include/common/hpack-tbl.h
@@ -52,7 +52,7 @@
  * possible to maximize the delay before a collision of DTEs and data. In order
  * to always insert from the right, we need to keep a reference to the latest
  * inserted element and look before it. The last inserted cell's address defines
- * the lowest konwn address still in use, unless the area wraps in which case
+ * the lowest known address still in use, unless the area wraps in which case
  * the available space lies between the end of the tail and the beginning of the
  * head.
  *
diff --git a/include/common/http.h b/include/common/http.h
index d3519bc..6f083d4 100644
--- a/include/common/http.h
+++ b/include/common/http.h
@@ -27,7 +27,7 @@
 #include <common/ist.h>
 
 /*
- * some macros mainly used when parsing header fileds.
+ * some macros mainly used when parsing header fields.
  * from RFC7230:
  *   CTL                 = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
  *   SEP                 = one of the 17 defined separators or SP or HT
diff --git a/include/common/htx.h b/include/common/htx.h
index 9818a3f..7bd12b4 100644
--- a/include/common/htx.h
+++ b/include/common/htx.h
@@ -37,7 +37,7 @@
  * metadata (htx_blk) and the associated payload. Blocks' metadata are stored
  * starting from the end of the array while their payload are stored at the
  * beginning. Blocks' metadata are often simply called blocks. it is a misuse of
- * language that's simplify explainations.
+ * language that's simplify explanations.
  *
  *
  *  +-----+---------------+------------------------------+--------------+
@@ -196,7 +196,7 @@
 			      * during parsing, from this start-line to the
 			      * corresponding EOH. -1 if unknown */
 
-	unsigned int len[3]; /* length of differnt parts of the start-line */
+	unsigned int len[3]; /* length of different parts of the start-line */
 	char         l[0];
 };
 
@@ -258,7 +258,7 @@
 void htx_move_blk_before(struct htx *htx, struct htx_blk **blk, struct htx_blk **ref);
 int htx_append_msg(struct htx *dst, const struct htx *src);
 
-/* Functions and macros to get parts of the start-line or legnth of these
+/* Functions and macros to get parts of the start-line or length of these
  * parts. Request and response start-lines are both composed of 3 parts.
  */
 #define HTX_SL_LEN(sl) ((sl)->len[0] + (sl)->len[1] + (sl)->len[2])
@@ -588,7 +588,7 @@
 
 
 /* Returns the value of the block <blk>, depending on its type. If there is no
- * value (for end-of blocks), an empty one is retruned.
+ * value (for end-of blocks), an empty one is returned.
  */
 static inline struct ist htx_get_blk_value(const struct htx *htx, const struct htx_blk *blk)
 {
@@ -617,9 +617,9 @@
 
 /* Removes <n> bytes from the beginning of DATA block <blk>. The block's start
  * address and its length are adjusted, and the htx's total data count is
- * updated. This is used to mark that part of some data were transfered
+ * updated. This is used to mark that part of some data were transferred
  * from a DATA block without removing this DATA block. No sanity check is
- * performed, the caller is reponsible for doing this exclusively on DATA
+ * performed, the caller is responsible for doing this exclusively on DATA
  * blocks, and never removing more than the block's size.
  */
 static inline void htx_cut_data_blk(struct htx *htx, struct htx_blk *blk, uint32_t n)
diff --git a/include/common/ist.h b/include/common/ist.h
index b19facd..68c83ff 100644
--- a/include/common/ist.h
+++ b/include/common/ist.h
@@ -722,7 +722,7 @@
 }
 
 /*
- * looks for the first occurence of <chr> in string <ist> and returns a shorter
+ * looks for the first occurrence of <chr> in string <ist> and returns a shorter
  * ist if char is found.
  */
 static inline struct ist iststop(const struct ist ist, char chr)
diff --git a/include/common/regex.h b/include/common/regex.h
index 0814f8f..0069b2d 100644
--- a/include/common/regex.h
+++ b/include/common/regex.h
@@ -84,9 +84,9 @@
  * "cs" is the case sensitive flag. If cs is true, case sensitive is enabled.
  * "cap" is capture flag. If cap if true the regex can capture into
  *       parenthesis strings.
- * "err" is the standar error message pointer.
+ * "err" is the standard error message pointer.
  *
- * The function return 1 is succes case, else return 0 and err is filled.
+ * The function return 1 is success case, else return 0 and err is filled.
  */
 struct my_regex *regex_comp(const char *str, int cs, int cap, char **err);
 int exp_replace(char *dst, unsigned int dst_size, char *src, const char *str, const regmatch_t *matches);
diff --git a/include/common/standard.h b/include/common/standard.h
index ea1e86d..40627b2 100644
--- a/include/common/standard.h
+++ b/include/common/standard.h
@@ -447,7 +447,7 @@
 /*
  * converts <str> to two struct in_addr* which must be pre-allocated.
  * The format is "addr[/mask]", where "addr" cannot be empty, and mask
- * is optionnal and either in the dotted or CIDR notation.
+ * is optional and either in the dotted or CIDR notation.
  * Note: "addr" can also be a hostname. Returns 1 if OK, 0 if error.
  */
 int str2net(const char *str, int resolve, struct in_addr *addr, struct in_addr *mask);
@@ -480,7 +480,7 @@
 /*
  * converts <str> to two struct in6_addr* which must be pre-allocated.
  * The format is "addr[/mask]", where "addr" cannot be empty, and mask
- * is an optionnal number of bits (128 being the default).
+ * is an optional number of bits (128 being the default).
  * Returns 1 if OK, 0 if error.
  */
 int str62net(const char *str, struct in6_addr *addr, unsigned char *mask);
@@ -756,7 +756,7 @@
 
 /* This function converts the time_t value <now> into a broken out struct tm
  * which must be allocated by the caller. It is highly recommended to use this
- * function intead of localtime() because that one requires a time_t* which
+ * function instead of localtime() because that one requires a time_t* which
  * is not always compatible with tv_sec depending on OS/hardware combinations.
  */
 static inline void get_localtime(const time_t now, struct tm *tm)
@@ -766,7 +766,7 @@
 
 /* This function converts the time_t value <now> into a broken out struct tm
  * which must be allocated by the caller. It is highly recommended to use this
- * function intead of gmtime() because that one requires a time_t* which
+ * function instead of gmtime() because that one requires a time_t* which
  * is not always compatible with tv_sec depending on OS/hardware combinations.
  */
 static inline void get_gmtime(const time_t now, struct tm *tm)
@@ -779,7 +779,7 @@
  * serves as a temporary origin. It's worth remembering that it's the first
  * year of each period that is leap and not the last one, so for instance year
  * 1 sees 366 days since year 0 was leap. For this reason we have to apply
- * modular arithmetics which is why we offset the year by 399 before
+ * modular arithmetic which is why we offset the year by 399 before
  * subtracting the excess at the end. No overflow here before ~11.7 million
  * years.
  */
@@ -987,7 +987,7 @@
 
 /*
  * Parse binary string written in hexadecimal (source) and store the decoded
- * result into binstr and set binstrlen to the lengh of binstr. Memory for
+ * result into binstr and set binstrlen to the length of binstr. Memory for
  * binstr is allocated by the function. In case of error, returns 0 with an
  * error message in err.
  */
@@ -1251,7 +1251,7 @@
 char *localdate2str_log(char *dst, time_t t, struct tm *tm, size_t size);
 
 /* These 3 functions parses date string and fills the
- * corresponding broken-down time in <tm>. In succes case,
+ * corresponding broken-down time in <tm>. In success case,
  * it returns 1, otherwise, it returns 0.
  */
 int parse_http_date(const char *date, int len, struct tm *tm);
@@ -1309,7 +1309,7 @@
 /* removes environment variable <name> from the environment as found in
  * environ. This is only provided as an alternative for systems without
  * unsetenv() (old Solaris and AIX versions). THIS IS NOT THREAD SAFE.
- * The principle is to scan environ for each occurence of variable name
+ * The principle is to scan environ for each occurrence of variable name
  * <name> and to replace the matching pointers with the last pointer of
  * the array (since variables are not ordered).
  * It always returns 0 (success).
diff --git a/include/common/xref.h b/include/common/xref.h
index f7fe26d..610a023 100644
--- a/include/common/xref.h
+++ b/include/common/xref.h
@@ -46,7 +46,7 @@
 		if (local == XREF_BUSY)
 			continue;
 
-		/* We are locked, the peer cant disapear, try to acquire
+		/* We are locked, the peer can't disappear, try to acquire
 		 * the pper's lock. Note that remote can't be NULL.
 		 */
 		remote = _HA_ATOMIC_XCHG(&local->peer, XREF_BUSY);
diff --git a/include/proto/connection.h b/include/proto/connection.h
index ecc03de..2118d23 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -681,7 +681,7 @@
 	case CO_ER_SSL_TIMEOUT:   return "Timeout during SSL handshake";
 	case CO_ER_SSL_TOO_MANY:  return "Too many SSL connections";
 	case CO_ER_SSL_NO_MEM:    return "Out of memory when initializing an SSL connection";
-	case CO_ER_SSL_RENEG:     return "Rejected a client-initiated SSL renegociation attempt";
+	case CO_ER_SSL_RENEG:     return "Rejected a client-initiated SSL renegotiation attempt";
 	case CO_ER_SSL_CA_FAIL:   return "SSL client CA chain cannot be verified";
 	case CO_ER_SSL_CRT_FAIL:  return "SSL client certificate not trusted";
 	case CO_ER_SSL_MISMATCH:  return "Server presented an SSL certificate different from the configured one";
diff --git a/include/proto/fd.h b/include/proto/fd.h
index 3c778ab..8dadae8 100644
--- a/include/proto/fd.h
+++ b/include/proto/fd.h
@@ -106,7 +106,7 @@
 void fd_rm_from_fd_list(volatile struct fdlist *list, int fd, int off);
 void updt_fd_polling(const int fd);
 
-/* Called from the poller to acknoledge we read an entry from the global
+/* Called from the poller to acknowledge we read an entry from the global
  * update list, to remove our bit from the update_mask, and remove it from
  * the list if we were the last one.
  */
diff --git a/include/proto/log.h b/include/proto/log.h
index 6c96432..a2e9d47 100644
--- a/include/proto/log.h
+++ b/include/proto/log.h
@@ -172,13 +172,13 @@
 
 /*
  * Write a IP address to the log string
- * +X option write in hexadecimal notation, most signifant byte on the left
+ * +X option write in hexadecimal notation, most significant byte on the left
  */
 char *lf_ip(char *dst, const struct sockaddr *sockaddr, size_t size, const struct logformat_node *node);
 
 /*
  * Write a port to the log
- * +X option write in hexadecimal notation, most signifant byte on the left
+ * +X option write in hexadecimal notation, most significant byte on the left
  */
 char *lf_port(char *dst, const struct sockaddr *sockaddr, size_t size, const struct logformat_node *node);
 
diff --git a/include/proto/pattern.h b/include/proto/pattern.h
index 73d3cdc..39514b1 100644
--- a/include/proto/pattern.h
+++ b/include/proto/pattern.h
@@ -51,7 +51,7 @@
 }
 
 /* This function executes a pattern match on a sample. It applies pattern <expr>
- * to sample <smp>. The function returns NULL if the sample dont match. It returns
+ * to sample <smp>. The function returns NULL if the sample don't match. It returns
  * non-null if the sample match. If <fill> is true and the sample match, the
  * function returns the matched pattern. In many cases, this pattern can be a
  * static buffer.
diff --git a/include/proto/proxy.h b/include/proto/proxy.h
index 7f108b5..db4cb89 100644
--- a/include/proto/proxy.h
+++ b/include/proto/proxy.h
@@ -147,7 +147,7 @@
 			     update_freq_ctr(&fe->fe_req_per_sec, 1));
 }
 
-/* Returns non-zero if the proxy is configured to retry a request if we got that status, 0 overwise */
+/* Returns non-zero if the proxy is configured to retry a request if we got that status, 0 otherwise */
 static inline int l7_status_match(struct proxy *p, int status)
 {
 	/* Just return 0 if no retry was configured for any status */
diff --git a/include/proto/server.h b/include/proto/server.h
index 0844e8a..516be49 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -95,7 +95,7 @@
 void srv_dump_kws(char **out);
 
 /* Recomputes the server's eweight based on its state, uweight, the current time,
- * and the proxy's algorihtm. To be used after updating sv->uweight. The warmup
+ * and the proxy's algorithm. To be used after updating sv->uweight. The warmup
  * state is automatically disabled if the time is elapsed.
  */
 void server_recalc_eweight(struct server *sv, int must_update);
diff --git a/include/proto/sink.h b/include/proto/sink.h
index 2947536..5028c25 100644
--- a/include/proto/sink.h
+++ b/include/proto/sink.h
@@ -34,7 +34,7 @@
 
 
 /* tries to send <nmsg> message parts (up to 8, ignored above) from message
- * array <msg> to sink <sink>. Formating according to the sink's preference is
+ * array <msg> to sink <sink>. Formatting according to the sink's preference is
  * done here. Lost messages are accounted for in the sink's counter. If there
  * were lost messages, an attempt is first made to indicate it.
  */
diff --git a/include/proto/task.h b/include/proto/task.h
index 84c2f8a..07da99d 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -335,7 +335,7 @@
 }
 
 /* Allocate and initialize a new tasklet, local to the thread by default. The
- * caller may assing its tid if it wants to own the tasklet.
+ * caller may assign its tid if it wants to own the tasklet.
  */
 static inline struct tasklet *tasklet_new(void)
 {
@@ -388,7 +388,7 @@
 		return;
 
 	task_unlink_wq(t);
-	/* We don't have to explicitely remove from the run queue.
+	/* We don't have to explicitly remove from the run queue.
 	 * If we are in the runqueue, the test below will set t->process
 	 * to NULL, and the task will be free'd when it'll be its turn
 	 * to run.
@@ -494,7 +494,7 @@
  * execution context. It contains a pointer to the associated task.
  * "link" is a list head attached to an other task that must be wake
  * the lua task if an event occurs. This is useful with external
- * events like TCP I/O or sleep functions. This funcion allocate
+ * events like TCP I/O or sleep functions. This function allocate
  * memory for the signal.
  */
 static inline struct notification *notification_new(struct list *purge, struct list *event, struct task *wakeup)
@@ -535,7 +535,7 @@
 }
 
 /* In some cases, the disconnected notifications must be cleared.
- * This function just release memory blocs. The purge list is not
+ * This function just release memory blocks. The purge list is not
  * locked because it is owned by only one process. Before browsing
  * this list, the caller must ensure to be the only one browser.
  * The "com" is not locked because when com->task is NULL, the
@@ -627,7 +627,7 @@
 
 /* Checks the next timer for the current thread by looking into its own timer
  * list and the global one. It may return TICK_ETERNITY if no timer is present.
- * Note that the next timer might very well be slighly in the past.
+ * Note that the next timer might very well be slightly in the past.
  */
 int next_timer_expiry();
 
diff --git a/include/types/filters.h b/include/types/filters.h
index 0b54951..1930e2a 100644
--- a/include/types/filters.h
+++ b/include/types/filters.h
@@ -65,7 +65,7 @@
  * - init_per_thread      : Initializes the filter for a proxy for a specific
  *                          thread. Returns a negative value if an error
  *                          occurs.
- * - deinit_per_thread    : Cleans up what the init_per_thread funcion has
+ * - deinit_per_thread    : Cleans up what the init_per_thread function has
  *                          done.
  *
  *
@@ -128,7 +128,7 @@
  *                          Returns a negative value if an error occurs, 0 if
  *                          it needs to wait for some reason, any other value
  *                          otherwise.
- *  - http_reset          : Called when the HTTP message is reseted. It happens
+ *  - http_reset          : Called when the HTTP message is reset. It happens
  *                          either when a 100-continue response is received.
  *                          that can be detected if s->txn->status is 10X, or
  *                          if we're attempting a L7 retry.
@@ -217,7 +217,7 @@
  *
  * 2D-Array fields are used to store info per channel. The first index stands
  * for the request channel, and the second one for the response channel.
- * Especially, <next> and <fwd> are offets representing amount of data that the
+ * Especially, <next> and <fwd> are offsets representing amount of data that the
  * filter are, respectively, parsed and forwarded on a channel. Filters can
  * access these values using FLT_NXT and FLT_FWD macros.
  */
diff --git a/include/types/pattern.h b/include/types/pattern.h
index 143524f..9ed6b4b 100644
--- a/include/types/pattern.h
+++ b/include/types/pattern.h
@@ -40,7 +40,7 @@
  *   - FAIL : no mattern may ever match
  *
  * We assign values 0, 1 and 3 to FAIL, MISS and PASS respectively, so that we
- * can make use of standard arithmetics for the truth tables below :
+ * can make use of standard arithmetic for the truth tables below :
  *
  *      x  | !x          x&y | F(0) | M(1) | P(3)     x|y | F(0) | M(1) | P(3)
  *   ------+-----       -----+------+------+-----    -----+------+------+-----
@@ -64,7 +64,7 @@
 /* possible flags for patterns matching or parsing */
 enum {
 	PAT_MF_IGNORE_CASE = 1 << 0,       /* ignore case */
-	PAT_MF_NO_DNS      = 1 << 1,       /* dont perform any DNS requests */
+	PAT_MF_NO_DNS      = 1 << 1,       /* don't perform any DNS requests */
 };
 
 /* possible flags for patterns storage */
@@ -186,7 +186,7 @@
 	struct pattern_head *pat_head; /* Point to the pattern_head that contain manipulation functions.
 	                                * Note that this link point on compatible head but not on the real
 	                                * head. You can use only the function, and you must not use the
-	                                * "head". Dont write "(struct pattern_expr *)any->pat_head->expr".
+	                                * "head". Don't write "(struct pattern_expr *)any->pat_head->expr".
 	                                */
 	struct list patterns;         /* list of acl_patterns */
 	struct eb_root pattern_tree;  /* may be used for lookup in large datasets */
diff --git a/include/types/protocol.h b/include/types/protocol.h
index f38baeb..39f99ca 100644
--- a/include/types/protocol.h
+++ b/include/types/protocol.h
@@ -50,7 +50,7 @@
 
 
 
-/* max length of a protcol name, including trailing zero */
+/* max length of a protocol name, including trailing zero */
 #define PROTO_NAME_LEN 16
 
 /* This structure contains all information needed to easily handle a protocol.