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);