MINOR: h1: make the H1 headers block parser able to parse headers only

Currently the H1 headers parser works for either a request or a response
because it starts from the start line. It is also able to resume its
processing when it was interrupted, but in this case it doesn't update
the list.

Make it support a new flag, H1_MF_HDRS_ONLY so that the caller can
indicate it's only interested in the headers list and not the start
line. This will be convenient to parse H1 trailers.
diff --git a/src/h1.c b/src/h1.c
index 37a1442..f9e8c9c 100644
--- a/src/h1.c
+++ b/src/h1.c
@@ -229,7 +229,9 @@
  * checked. In case of an unparsable response message, a negative value will be
  * returned with h1m->err_pos and h1m->err_state matching the location and
  * state where the error was met. Leading blank likes are tolerated but not
- * recommended.
+ * recommended. If flag H1_MF_HDRS_ONLY is set in h1m->flags, only headers are
+ * parsed and the start line is skipped. It is not required to set h1m->state
+ * nor h1m->next in this case.
  *
  * This function returns :
  *    -1 in case of error. In this case, h1m->err_state is filled (if h1m is
@@ -266,12 +268,17 @@
 	sl.st.status = 0;
 	skip_update = restarting = 0;
 
+	if (h1m->flags & H1_MF_HDRS_ONLY) {
+		state = H1_MSG_HDR_FIRST;
+		h1m->next = 0;
+	}
+	else if (h1m->state == H1_MSG_RQBEFORE || h1m->state == H1_MSG_RPBEFORE)
+		state = h1m->state;
+	else
+		restarting = 1;
+
 	ptr   = start + h1m->next;
 	end   = stop;
-	state = h1m->state;
-
-	if (state != H1_MSG_RQBEFORE && state != H1_MSG_RPBEFORE)
-		restarting = 1;
 
 	if (unlikely(ptr >= end))
 		goto http_msg_ood;