MINOR: http: Add function to parse value of the header Status

It will be used by the mux FCGI to get the status a response.
diff --git a/src/http.c b/src/http.c
index c77f8c8..fe7ed4c 100644
--- a/src/http.c
+++ b/src/http.c
@@ -980,3 +980,34 @@
 
         return 1;
 }
+
+/* Parses value of a Status header with the following format: "Status: Code[
+ * Reason]".  The parsing is pretty naive and just skip spaces. It return the
+ * numeric value of the status code.
+ */
+int http_parse_status_val(const struct ist value, struct ist *status, struct ist *reason)
+{
+	char *p   = value.ptr;
+        char *end = p + value.len;
+	uint16_t code;
+
+	status->len = reason->len = 0;
+
+	/* Skip leading spaces */
+        for (; p < end && HTTP_IS_SPHT(*p); p++);
+
+        /* Set the status part */
+        status->ptr = p;
+        for (; p < end && HTTP_IS_TOKEN(*p); p++);
+        status->len = p - status->ptr;
+
+	/* Skip spaces between status and reason */
+        for (; p < end && HTTP_IS_SPHT(*p); p++);
+
+	/* the remaining is the reason */
+        reason->ptr = p;
+        reason->len = end - p;
+
+	code = strl2ui(status->ptr, status->len);
+	return code;
+}