MINOR: htx: Be sure to xfer all headers in one time in htx_xfer_blks()

In the function htx_xfer_blks(), we take care to transfer all headers in one
time. When the current block is a start-line, we check if there is enough space
to transfer all headers too. If not, and if the destination is empty, a parsing
error is reported on the source.

The H2 multiplexer is the only one to use this function. When a parsing error is
reported during the transfer, the flag CS_FL_EOI is also set on the conn_stream.
diff --git a/src/htx.c b/src/htx.c
index bc2ecbd..a7623b6 100644
--- a/src/htx.c
+++ b/src/htx.c
@@ -502,6 +502,19 @@
 		if (type == HTX_BLK_UNUSED)
 			goto next;
 
+		/* Be sure to have enough space to xfer all headers in one
+		 * time. If not while <dst> is empty, we report a parsing error
+		 * on <src>.
+		 */
+		if (mark >= HTX_BLK_EOH && (type == HTX_BLK_REQ_SL || type == HTX_BLK_RES_SL)) {
+			struct htx_sl *sl = htx_get_blk_ptr(src, blk);
+
+			if (sl->hdrs_bytes != -1 && sl->hdrs_bytes > count) {
+				if (htx_is_empty(dst))
+					src->flags |= HTX_FL_PARSING_ERROR;
+				break;
+			}
+		}
 
 		sz = htx_get_blksz(blk);
 		info = blk->info;
diff --git a/src/mux_h2.c b/src/mux_h2.c
index ddaa751..55c7619 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -5406,8 +5406,11 @@
 
 		htx_xfer_blks(buf_htx, h2s_htx, count, HTX_BLK_EOM);
 
-		if (h2s_htx->flags & HTX_FL_PARSING_ERROR)
+		if (h2s_htx->flags & HTX_FL_PARSING_ERROR) {
 			buf_htx->flags |= HTX_FL_PARSING_ERROR;
+			if (htx_is_empty(buf_htx))
+				cs->flags |= CS_FL_EOI;
+		}
 
 		buf_htx->extra = (h2s_htx->extra ? (h2s_htx->data + h2s_htx->extra) : 0);
 		htx_to_buf(buf_htx, buf);