MEDIUM: http/htx: Perform analysis relatively to the first block

The first block is the start-line, if defined. Otherwise it the head of the HTX
message. So now, during HTTP analysis, lookup are all done using the first block
instead of the head. Concretely, for now, it is the same because only one HTTP
message is stored at a time in an HTX message. 1xx informational messages are
handled separatly from the final reponse and from each other. But it will make
sense when the 1xx informational messages and the associated final reponse will
be stored in the same HTX message.
diff --git a/src/backend.c b/src/backend.c
index fc00666..88991a8 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -347,7 +347,7 @@
 
 		p = params = NULL;
 		len = 0;
-		for (blk = htx_get_head_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) {
+		for (blk = htx_get_first_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) {
 			enum htx_blk_type type = htx_get_blk_type(blk);
 			struct ist v;
 
diff --git a/src/cache.c b/src/cache.c
index 188efea..1fec57e 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -715,7 +715,7 @@
 		}
 
 		chunk_reset(&trash);
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 			uint32_t sz = htx_get_blksz(blk);
diff --git a/src/da.c b/src/da.c
index 6c7ce81..f5e0135 100644
--- a/src/da.c
+++ b/src/da.c
@@ -307,7 +307,7 @@
 		}
 
 		i = 0;
-		for (blk = htx_get_head_blk(htx); nbh < DA_MAX_HEADERS && blk; blk = htx_get_next_blk(htx, blk)) {
+		for (blk = htx_get_first_blk(htx); nbh < DA_MAX_HEADERS && blk; blk = htx_get_next_blk(htx, blk)) {
 			size_t vlen;
 			char *pval;
 			da_evidence_id_t evid;
diff --git a/src/filters.c b/src/filters.c
index 95ba772..62e256e 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -933,7 +933,7 @@
 		struct htx *htx = htxbuf(&chn->buf);
 		int32_t pos;
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			c_adv(chn, htx_get_blksz(blk));
 			if (htx_get_blk_type(blk) == HTX_BLK_EOH)
diff --git a/src/flt_trace.c b/src/flt_trace.c
index ed159e8..3a14244 100644
--- a/src/flt_trace.c
+++ b/src/flt_trace.c
@@ -422,7 +422,7 @@
 			   HTX_SL_P2_LEN(sl), HTX_SL_P2_PTR(sl),
 			   HTX_SL_P3_LEN(sl), HTX_SL_P3_PTR(sl));
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 			struct ist n, v;
diff --git a/src/hlua.c b/src/hlua.c
index 72ce6ba..bb8c93d 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -3993,7 +3993,7 @@
 			lua_settable(L, -3);
 		}
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 
@@ -4210,7 +4210,7 @@
 
 	htx = htx_from_buf(&req->buf);
 	count = co_data(req);
-	blk = htx_get_head_blk(htx);
+	blk = htx_get_first_blk(htx);
 
 	while (count && !stop && blk) {
 		enum htx_blk_type type = htx_get_blk_type(blk);
@@ -4366,7 +4366,7 @@
 	htx = htx_from_buf(&req->buf);
 	len = MAY_LJMP(luaL_checkinteger(L, 2));
 	count = co_data(req);
-	blk = htx_get_head_blk(htx);
+	blk = htx_get_first_blk(htx);
 	while (count && len && blk) {
 		enum htx_blk_type type = htx_get_blk_type(blk);
 		uint32_t sz = htx_get_blksz(blk);
@@ -5197,7 +5197,7 @@
 		struct htx *htx = htxbuf(&msg->chn->buf);
 		int32_t pos;
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 			struct ist n, v;
@@ -7213,7 +7213,7 @@
 		 * the Lua.
 		 */
 		req_htx = htx_from_buf(&req->buf);
-		blk = htx_get_head_blk(req_htx);
+		blk = htx_get_first_blk(req_htx);
 		while (count && blk) {
 			enum htx_blk_type type = htx_get_blk_type(blk);
 			uint32_t sz = htx_get_blksz(blk);
diff --git a/src/http_fetch.c b/src/http_fetch.c
index 0a5a2f9..395e665 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -615,7 +615,7 @@
 		if (!htx)
 			return 0;
 		temp = get_trash_chunk();
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 
@@ -687,7 +687,7 @@
 		temp = get_trash_chunk();
 		p = temp->area;
 		end = temp->area + temp->size;
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 			struct ist n, v;
@@ -844,7 +844,7 @@
 			return 0;
 
 		temp = get_trash_chunk();
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 
@@ -915,7 +915,7 @@
 		if (!htx)
 			return 0;
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 
@@ -963,7 +963,7 @@
 		if (!htx)
 			return 0;
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 
@@ -1281,7 +1281,7 @@
 			del = *args[0].data.str.area;
 
 		temp = get_trash_chunk();
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 			struct ist n;
@@ -2590,7 +2590,7 @@
 				return 0;
 
 			temp   = get_trash_chunk();
-			for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+			for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 				struct htx_blk   *blk  = htx_get_blk(htx, pos);
 				enum htx_blk_type type = htx_get_blk_type(blk);
 
diff --git a/src/http_htx.c b/src/http_htx.c
index 8099071..15865d5 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -80,7 +80,7 @@
 	if (!htx->used)
 		return 0;
 
-	for (blk = htx_get_head_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) {
+	for (blk = htx_get_first_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) {
 	  rescan_hdr:
 		type = htx_get_blk_type(blk);
 		if (type == HTX_BLK_EOH || type == HTX_BLK_EOM)
@@ -143,7 +143,7 @@
 
 	/* <blk> is the head, swap it iteratively with its predecessor to place
 	 * it just before the end-of-header block. So blocks remains ordered. */
-	for (prev = htx_get_prev(htx, htx->tail); prev != -1; prev = htx_get_prev(htx, prev)) {
+	for (prev = htx_get_prev(htx, htx->tail); prev != htx->sl_pos; prev = htx_get_prev(htx, prev)) {
 		struct htx_blk   *pblk = htx_get_blk(htx, prev);
 		enum htx_blk_type type = htx_get_blk_type(pblk);
 
diff --git a/src/proto_htx.c b/src/proto_htx.c
index 35039fc..dbbd937 100644
--- a/src/proto_htx.c
+++ b/src/proto_htx.c
@@ -300,7 +300,7 @@
 
 		htx_debug_stline("clireq", s, sl);
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 
@@ -1655,7 +1655,7 @@
 
 		htx_debug_stline("srvrep", s, sl);
 
-		for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+		for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 			struct htx_blk *blk = htx_get_blk(htx, pos);
 			enum htx_blk_type type = htx_get_blk_type(blk);
 
@@ -3531,7 +3531,7 @@
 
 	htx = htxbuf(&req->buf);
 
-	for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+	for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 		struct htx_blk *blk = htx_get_blk(htx, pos);
 		enum htx_blk_type type;
 		struct ist n, v;
@@ -3749,7 +3749,7 @@
 
 	htx = htxbuf(&res->buf);
 
-	for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+	for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 		struct htx_blk *blk = htx_get_blk(htx, pos);
 		enum htx_blk_type type;
 		struct ist n, v;
@@ -4643,7 +4643,7 @@
 
 	htx = htxbuf(&req->buf);
 	pragma_found = cc_found = 0;
-	for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+	for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
                 struct htx_blk *blk = htx_get_blk(htx, pos);
                 enum htx_blk_type type = htx_get_blk_type(blk);
 		struct ist n, v;
@@ -4731,7 +4731,7 @@
 	}
 
 	htx = htxbuf(&res->buf);
-	for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+	for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
                 struct htx_blk *blk  = htx_get_blk(htx, pos);
                 enum htx_blk_type type = htx_get_blk_type(blk);
 		struct ist n, v;
@@ -5564,7 +5564,7 @@
 	struct cap_hdr *h;
 	int32_t pos;
 
-	for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
+	for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
 		struct htx_blk *blk = htx_get_blk(htx, pos);
 		enum htx_blk_type type = htx_get_blk_type(blk);
 		struct ist n, v;
diff --git a/src/stats.c b/src/stats.c
index 7d9a8a3..a8f9795 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -2788,7 +2788,7 @@
 		}
 
 		/* The request was fully received. Copy data */
-		blk = htx_get_head_blk(htx);
+		blk = htx_get_first_blk(htx);
 		while (blk) {
 			enum htx_blk_type type = htx_get_blk_type(blk);