MEDIUM: proto_htx: Convert all HTTP error messages into HTX

During startup, after the configuration parsing, all HTTP error messages
(errorloc, errorfile or default messages) are converted into HTX messages and
stored in dedicated buffers. We use it to return errors in the HTX analyzers
instead of using ugly OOB blocks.
diff --git a/include/common/http.h b/include/common/http.h
index 0835d07..66acfd3 100644
--- a/include/common/http.h
+++ b/include/common/http.h
@@ -119,6 +119,7 @@
 };
 
 extern const int http_err_codes[HTTP_ERR_SIZE];
+extern const char *http_err_msgs[HTTP_ERR_SIZE];
 extern struct buffer http_err_chunks[HTTP_ERR_SIZE];
 const struct ist http_known_methods[HTTP_METH_OTHER];
 extern const uint8_t http_char_classes[256];
diff --git a/include/proto/http_htx.h b/include/proto/http_htx.h
index 9afea5c..7a2e008 100644
--- a/include/proto/http_htx.h
+++ b/include/proto/http_htx.h
@@ -24,10 +24,13 @@
 #define _PROTO_HTTP_HTX_H
 
 #include <common/buf.h>
+#include <common/ist.h>
 
 #include <types/h1.h>
 #include <types/http_htx.h>
 
+extern struct buffer htx_err_chunks[HTTP_ERR_SIZE];
+
 struct htx_sl *http_find_stline(struct htx *htx);
 int http_find_header(const struct htx *htx, const struct ist name, struct http_hdr_ctx *ctx, int full);
 int http_add_header(struct htx *htx, const struct ist n, const struct ist v);
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
index 7546f01..7394619 100644
--- a/include/proto/proto_http.h
+++ b/include/proto/proto_http.h
@@ -78,7 +78,7 @@
 void htx_perform_server_redirect(struct stream *s, struct stream_interface *si);
 void htx_server_error(struct stream *s, struct stream_interface *si, int err, int finst, const struct buffer *msg);
 void htx_reply_and_close(struct stream *s, short status, struct buffer *msg);
-
+struct buffer *htx_error_message(struct stream *s);
 
 void debug_hdr(const char *dir, struct stream *s, const char *start, const char *end);
 int apply_filter_to_req_headers(struct stream *s, struct channel *req, struct hdr_exp *exp);