]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http-htx: Export functions to update message authority and host
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Apr 2020 17:57:29 +0000 (19:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 29 Apr 2020 11:32:29 +0000 (13:32 +0200)
These functions will be used by HTTP health checks when a request is formatted
before sending it.

include/proto/http_htx.h
src/http_htx.c

index 617417ad5ce61a14529f231bf51d626a68d71583..99d56b42be0f600f1a6bbc7eb57baa581cd83c09 100644 (file)
@@ -45,6 +45,9 @@ int http_replace_res_reason(struct htx *htx, const struct ist reason);
 int http_replace_header_value(struct htx *htx, struct http_hdr_ctx *ctx, const struct ist data);
 int http_replace_header(struct htx *htx, struct http_hdr_ctx *ctx, const struct ist name, const struct ist value);
 int http_remove_header(struct htx *htx, struct http_hdr_ctx *ctx);
+int http_update_authority(struct htx *htx, struct htx_sl *sl, const struct ist host);
+int http_update_host(struct htx *htx, struct htx_sl *sl, const struct ist uri);
+
 unsigned int http_get_htx_hdr(const struct htx *htx, const struct ist hdr,
                              int occ, struct http_hdr_ctx *ctx, char **vptr, size_t *vlen);
 unsigned int http_get_htx_fhdr(const struct htx *htx, const struct ist hdr,
index 13b11a38aaca1c99c5460f567e5ddd67e35d57c0..e8420a993bfb5b3cfed63037093d5d27b1303a20 100644 (file)
@@ -53,9 +53,6 @@ struct conf_errors {
        struct list list;                           /* next conf_errors */
 };
 
-static int http_update_authority(struct htx *htx, struct htx_sl *sl, const struct ist host);
-static int http_update_host(struct htx *htx, struct htx_sl *sl, const struct ist uri);
-
 /* Returns the next unporocessed start line in the HTX message. It returns NULL
  * if the start-line is undefined (first == -1). Otherwise, it returns the
  * pointer on the htx_sl structure.
@@ -577,7 +574,7 @@ int http_remove_header(struct htx *htx, struct http_hdr_ctx *ctx)
  * contains an authority. Thus, if no authority is found in the uri, an error is
  * returned.
  */
-static int http_update_authority(struct htx *htx, struct htx_sl *sl, const struct ist host)
+int http_update_authority(struct htx *htx, struct htx_sl *sl, const struct ist host)
 {
        struct buffer *temp = get_trash_chunk();
        struct ist meth, vsn, uri, authority;
@@ -614,7 +611,7 @@ static int http_update_authority(struct htx *htx, struct htx_sl *sl, const struc
  * authority is used to set the value of the header host. This function returns
  * 0 on failure and 1 on success.
 */
-static int http_update_host(struct htx *htx, struct htx_sl *sl, const struct ist uri)
+int http_update_host(struct htx *htx, struct htx_sl *sl, const struct ist uri)
 {
        struct ist authority;
        struct http_hdr_ctx ctx;