MEDIUM: htx: Don't rely on h1_sl anymore except during H1 header parsing
Instead, we now use the htx_sl coming from the HTX message. It avoids to have
too H1 specific code in version-agnostic parts. Of course, the concept of the
start-line is higly influenced by the H1, but the structure htx_sl can be
adapted, if necessary. And many things depend on a start-line during HTTP
analyzis. Using the structure htx_sl also avoid boring conversions between HTX
version and H1 version.
diff --git a/include/proto/http_htx.h b/include/proto/http_htx.h
index 7a6d476..9afea5c 100644
--- a/include/proto/http_htx.h
+++ b/include/proto/http_htx.h
@@ -28,11 +28,10 @@
#include <types/h1.h>
#include <types/http_htx.h>
-union h1_sl http_find_stline(const struct htx *htx);
+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);
-int http_replace_reqline(struct htx *htx, const union h1_sl sl);
-int http_replace_resline(struct htx *htx, const union h1_sl sl);
+int http_replace_stline(struct htx *htx, const struct ist p1, const struct ist p2, const struct ist p3);
int http_replace_req_meth(struct htx *htx, const struct ist meth);
int http_replace_req_uri(struct htx *htx, const struct ist uri);
int http_replace_req_path(struct htx *htx, const struct ist path);
diff --git a/include/proto/htx.h b/include/proto/htx.h
index 296ff4d..9ee71e5 100644
--- a/include/proto/htx.h
+++ b/include/proto/htx.h
@@ -26,8 +26,6 @@
#include <common/config.h>
#include <common/standard.h>
#include <common/http-hdr.h>
-
-#include <types/h1.h>
#include <types/htx.h>
extern struct htx htx_empty;
@@ -41,15 +39,14 @@
struct htx_ret htx_xfer_blks(struct htx *dst, struct htx *src, uint32_t count,
enum htx_blk_type mark);
-struct htx_blk *htx_replace_reqline(struct htx *htx, struct htx_blk *blk,
- const union h1_sl sl);
-struct htx_blk *htx_replace_resline(struct htx *htx, struct htx_blk *blk,
- const union h1_sl sl);
+struct htx_sl *htx_add_stline(struct htx *htx, enum htx_blk_type type, unsigned int flags,
+ const struct ist p1, const struct ist p2, const struct ist p3);
+struct htx_sl *htx_replace_stline(struct htx *htx, struct htx_blk *blk, const struct ist p1,
+ const struct ist p2, const struct ist p3);
+
struct htx_blk *htx_replace_header(struct htx *htx, struct htx_blk *blk,
const struct ist name, const struct ist value);
-struct htx_blk *htx_add_reqline(struct htx *htx, const union h1_sl sl);
-struct htx_blk *htx_add_resline(struct htx *htx, const union h1_sl sl);
struct htx_blk *htx_add_header(struct htx *htx, const struct ist name, const struct ist value);
struct htx_blk *htx_add_all_headers(struct htx *htx, const struct http_hdr *hdrs);
struct htx_blk *htx_add_pseudo_header(struct htx *htx, enum htx_phdr_type phdr, const struct ist value);