CLEANUP: assorted typo fixes in the code and comments

This is 8th iteration of typo fixes
diff --git a/src/hlua.c b/src/hlua.c
index 98fa354..67aa2c6 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -111,7 +111,7 @@
  * code and recompile the library. This system will probably not accepted
  * by maintainers of various distribs.
  *
- * Our main excution point of the Lua is the function lua_resume(). A
+ * Our main execution point of the Lua is the function lua_resume(). A
  * quick looking on the Lua sources displays a lua_lock() a the start
  * of function and a lua_unlock() at the end of the function. So I
  * conclude that the Lua thread safe mode just perform a mutex around
@@ -653,7 +653,7 @@
 			return 0;
 		}
 
-		/* Check for exceed the number of requiered argument. */
+		/* Check for exceed the number of required argument. */
 		if ((mask & ARGT_MASK) == ARGT_STOP &&
 		    argp[idx].type != ARGT_STOP) {
 			WILL_LJMP(luaL_argerror(L, first + idx, "Last argument expected"));
@@ -883,18 +883,18 @@
  * throws an error (longjmp).
  *
  * In some case (at least one), this function can be called from safe
- * environement, so we must not initialise it. While the support of
+ * environment, so we must not initialise it. While the support of
  * threads appear, the safe environment set a lock to ensure only one
  * Lua execution at a time. If we initialize safe environment in another
- * safe environmenet, we have a dead lock.
+ * safe environment, we have a dead lock.
  *
  * set "already_safe" true if the context is initialized form safe
- * Lua fonction.
+ * Lua function.
  *
  * This function manipulates two Lua stacks: the main and the thread. Only
  * the main stack can fail. The thread is not manipulated. This function
  * MUST NOT manipulate the created thread stack state, because it is not
- * proctected against errors thrown by the thread stack.
+ * protected against errors thrown by the thread stack.
  */
 int hlua_ctx_init(struct hlua *lua, struct task *task, int already_safe)
 {
@@ -1023,7 +1023,7 @@
 
 	/* Lua cannot yield when its returning from a function,
 	 * so, we can fix the interrupt hook to 1 instruction,
-	 * expecting that the function is finnished.
+	 * expecting that the function is finished.
 	 */
 	if (lua_gethookmask(L) & LUA_MASKRET) {
 		lua_sethook(hlua->T, hlua_hook, LUA_MASKCOUNT, 1);
@@ -1418,7 +1418,7 @@
  *    __pow    "^"
  *    __concat ".."
  *
- * Special methods for redfining standar relations
+ * Special methods for redefining standard relations
  * http://www.lua.org/pil/13.2.html
  *
  *    __eq "=="
@@ -2540,7 +2540,7 @@
 
 	tmout = MS_TO_TICKS((int)dtmout);
 	if (tmout == 0)
-		tmout++; /* very small timeouts are adjusted to a minium of 1ms */
+		tmout++; /* very small timeouts are adjusted to a minimum of 1ms */
 
 	/* Check if we run on the same thread than the xreator thread.
 	 * We cannot access to the socket if the thread is different.
@@ -2598,7 +2598,7 @@
 	memset(socket, 0, sizeof(*socket));
 	socket->tid = tid;
 
-	/* Check if the various memory pools are intialized. */
+	/* Check if the various memory pools are initialized. */
 	if (!pool_head_stream || !pool_head_buffer) {
 		hlua_pusherror(L, "socket: uninitialized pools.");
 		goto out_fail_conf;
@@ -2884,7 +2884,7 @@
 	if (max == 0 && co_data(chn) == 0) {
 		/* There are no space available, and the output buffer is empty.
 		 * in this case, we cannot add more data, so we cannot yield,
-		 * we return the amount of copyied data.
+		 * we return the amount of copied data.
 		 */
 		return 1;
 	}
@@ -2971,7 +2971,7 @@
 
 	/* If there is no space available, and the output buffer is empty.
 	 * in this case, we cannot add more data, so we cannot yield,
-	 * we return the amount of copyied data.
+	 * we return the amount of copied data.
 	 */
 	if (max == 0 && co_data(chn) == 0)
 		return 1;
@@ -3000,7 +3000,7 @@
 
 	/* If there is no space available, and the output buffer is empty.
 	 * in this case, we cannot add more data, so we cannot yield,
-	 * we return the amount of copyied data.
+	 * we return the amount of copied data.
 	 */
 	max = b_room(&chn->buf);
 	if (max == 0 && co_data(chn) == 0)
@@ -3021,7 +3021,7 @@
 	return 1;
 }
 
-/* Just a wraper of "_hlua_channel_send". This wrapper permits
+/* Just a wrapper of "_hlua_channel_send". This wrapper permits
  * yield the LUA process, and resume it without checking the
  * input arguments.
  */
@@ -3038,7 +3038,7 @@
  * forwarded. This function never fails.
  *
  * The Lua function takes an amount of bytes to be forwarded in
- * imput. It returns the number of bytes forwarded.
+ * input. It returns the number of bytes forwarded.
  */
 __LJMP static int hlua_channel_forward_yield(lua_State *L, int status, lua_KContext ctx)
 {
@@ -3686,7 +3686,7 @@
 
 	} else {
 
-		/* Copy the fisrt block caping to the length required. */
+		/* Copy the first block caping to the length required. */
 		if (len1 > len)
 			len1 = len;
 		luaL_addlstring(&appctx->b, blk1, len1);
@@ -3781,7 +3781,7 @@
 	return 1;
 }
 
-/* Just a wraper of "hlua_applet_tcp_send_yield". This wrapper permits
+/* Just a wrapper of "hlua_applet_tcp_send_yield". This wrapper permits
  * yield the LUA process, and resume it without checking the
  * input arguments.
  */
@@ -4312,7 +4312,7 @@
 	return 1;
 }
 
-/* Just a wraper of "hlua_applet_send_yield". This wrapper permits
+/* Just a wrapper of "hlua_applet_send_yield". This wrapper permits
  * yield the LUA process, and resume it without checking the
  * input arguments.
  */
@@ -4326,7 +4326,7 @@
 		WILL_LJMP(lua_error(L));
 	}
 
-	/* This interger is used for followinf the amount of data sent. */
+	/* This integer is used for followinf the amount of data sent. */
 	lua_pushinteger(L, 0);
 
 	return MAY_LJMP(hlua_applet_http_send_yield(L, 0, 0));
@@ -4549,8 +4549,8 @@
 	/* If we dont have a content-length set, and the HTTP version is 1.1
 	 * and the status code implies the presence of a message body, we must
 	 * announce a transfer encoding chunked. This is required by haproxy
-	 * for the keepalive compliance. If the applet annouces a transfer-encoding
-	 * chunked itslef, don't do anything.
+	 * for the keepalive compliance. If the applet announces a transfer-encoding
+	 * chunked itself, don't do anything.
 	 */
 	if ((flags & (HTX_SL_F_VER_11|HTX_SL_F_XFER_LEN)) == HTX_SL_F_VER_11 &&
 	    appctx->appctx->ctx.hlua_apphttp.status >= 200 &&
@@ -5363,7 +5363,7 @@
 }
 
 /* Forward the Reply object to the client. This function converts the reply in
- * HTX an push it to into the response channel. It is response to foward the
+ * HTX an push it to into the response channel. It is response to forward the
  * message and terminate the transaction. It returns 1 on success and 0 on
  * error. The Reply must be on top of the stack.
  */
@@ -6985,7 +6985,7 @@
 	if (unlikely(si->state == SI_ST_DIS || si->state == SI_ST_CLO))
 		goto out;
 
-	/* Check if the input buffer is avalaible. */
+	/* Check if the input buffer is available. */
 	if (!b_size(&res->buf)) {
 		si_rx_room_blk(si);
 		goto out;
@@ -7147,7 +7147,7 @@
 }
 
 /* global {tcp|http}-request parser. Return ACT_RET_PRS_OK in
- * succes case, else return ACT_RET_PRS_ERR.
+ * success case, else return ACT_RET_PRS_ERR.
  *
  * This function can fail with an abort() due to an Lua critical error.
  * We are in the configuration parsing process of HAProxy, this abort() is
@@ -7202,9 +7202,9 @@
 	struct hlua_function *fcn = rule->kw->private;
 
 	/* HTTP applets are forbidden in tcp-request rules.
-	 * HTTP applet request requires everything initilized by
+	 * HTTP applet request requires everything initialized by
 	 * "http_process_request" (analyzer flag AN_REQ_HTTP_INNER).
-	 * The applet will be immediately initilized, but its before
+	 * The applet will be immediately initialized, but its before
 	 * the call of this analyzer.
 	 */
 	if (rule->from != ACT_F_HTTP_REQ) {
@@ -7893,7 +7893,7 @@
 	enum hlua_exec ret;
 	const char *error;
 
-	/* Call post initialisation function in safe environement. */
+	/* Call post initialisation function in safe environment. */
 	if (!SET_SAFE_LJMP(gL.T)) {
 		if (lua_type(gL.T, -1) == LUA_TSTRING)
 			error = lua_tostring(gL.T, -1);
diff --git a/src/log.c b/src/log.c
index 2d92664..c2153b8 100644
--- a/src/log.c
+++ b/src/log.c
@@ -613,7 +613,7 @@
 				var = str;
 			}
 			else if (*str == '%')
-				cformat = LF_TEXT;     // convert this character to a litteral (useful for '%')
+				cformat = LF_TEXT;     // convert this character to a literal (useful for '%')
 			else if (isdigit((unsigned char)*str) || *str == ' ' || *str == '\t') {
 				/* single '%' followed by blank or digit, send them both */
 				cformat = LF_TEXT;
@@ -625,7 +625,7 @@
 
 			}
 			else
-				cformat = LF_INIT;     // handle other cases of litterals
+				cformat = LF_INIT;     // handle other cases of literals
 			break;
 
 		case LF_STARG:                         // text immediately following '%{'
@@ -726,7 +726,7 @@
 }
 
 /*
- * Parse the first range of indexes from a string made of a list of comma seperated
+ * Parse the first range of indexes from a string made of a list of comma separated
  * ranges of indexes. Note that an index may be considered as a particular range
  * with a high limit to the low limit.
  */
@@ -1364,7 +1364,7 @@
 
 /*
  * 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)
 {
@@ -1402,7 +1402,7 @@
 
 /*
  * 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/src/standard.c b/src/standard.c
index eba7910..e3e81ba 100644
--- a/src/standard.c
+++ b/src/standard.c
@@ -1142,7 +1142,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)
@@ -1193,7 +1193,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)
@@ -1276,7 +1276,7 @@
 
 /*
  * Resolve destination server from URL. Convert <str> to a sockaddr_storage.
- * <out> contain the code of the dectected scheme, the start and length of
+ * <out> contain the code of the detected scheme, the start and length of
  * the hostname. Actually only http and https are supported. <out> can be NULL.
  * This function returns the consumed length. It is useful if you parse complete
  * url like http://host:port/path, because the consumed length corresponds to
@@ -2187,9 +2187,9 @@
 
 /*
  * 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. In succes case, it returns the consumed length.
+ * error message in err. In success case, it returns the consumed length.
  */
 int parse_binary(const char *source, char **binstr, int *binstrlen, char **err)
 {
@@ -2403,7 +2403,7 @@
 /* Converts any text-formatted IPv4 address to a host-order IPv4 address. It
  * is particularly fast because it avoids expensive operations such as
  * multiplies, which are optimized away at the end. It requires a properly
- * formated address though (3 points).
+ * formatted address though (3 points).
  */
 unsigned int inetaddr_host(const char *text)
 {
@@ -3765,7 +3765,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/src/stats.c b/src/stats.c
index 36be315..46475cc 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -3276,7 +3276,7 @@
 	if (unlikely(si->state == SI_ST_DIS || si->state == SI_ST_CLO))
 		goto out;
 
-	/* Check if the input buffer is avalaible. */
+	/* Check if the input buffer is available. */
 	if (!b_size(&res->buf)) {
 		si_rx_room_blk(si);
 		goto out;
@@ -3397,7 +3397,7 @@
 }
 
 /* Fill <info> with HAProxy global info. <info> is preallocated
- * array of length <len>. The length of the aray must be
+ * array of length <len>. The length of the array must be
  * INF_TOTAL_FIELDS. If this length is less then this value, the
  * function returns 0, otherwise, it returns 1.
  */
diff --git a/src/task.c b/src/task.c
index e6be240..f58e5f9 100644
--- a/src/task.c
+++ b/src/task.c
@@ -277,7 +277,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()
 {