]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: http-ana: Remove the unused function http_send_name_header()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 24 Sep 2019 14:22:32 +0000 (16:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Sep 2019 06:48:53 +0000 (08:48 +0200)
Because the HTTP multiplexers are now responsible to handle the option
"http-send-name-header", the function http_send_name_header() can be removed.

include/proto/http_ana.h
src/http_ana.c

index 66895f479f39de0fd2e38ed53fb1e1aadb3c8cfc..a0db643830a0b6d09a82cb8feb29b358fd5a092d 100644 (file)
@@ -47,7 +47,6 @@ int http_req_replace_stline(int action, const char *replace, int len,
 void http_res_set_status(unsigned int status, const char *reason, struct stream *s);
 void http_check_request_for_cacheability(struct stream *s, struct channel *req);
 void http_check_response_for_cacheability(struct stream *s, struct channel *res);
-int http_send_name_header(struct stream *s, struct proxy *be, const char *srv_name);
 void http_perform_server_redirect(struct stream *s, struct stream_interface *si);
 void http_server_error(struct stream *s, struct stream_interface *si, int err, int finst, const struct buffer *msg);
 void http_reply_and_close(struct stream *s, short status, struct buffer *msg);
index b5089d11bf8e3a43005a868c64dbbc6655f85562..70956579fd619d9b8f8a33a724d6c8fbcd5b7ece 100644 (file)
@@ -4314,36 +4314,6 @@ void http_check_response_for_cacheability(struct stream *s, struct channel *res)
        }
 }
 
-/* send a server's name with an outgoing request over an established connection.
- * Note: this function is designed to be called once the request has been
- * scheduled for being forwarded. This is the reason why the number of forwarded
- * bytes have to be adjusted.
- */
-int http_send_name_header(struct stream *s, struct proxy *be, const char *srv_name)
-{
-       struct htx *htx;
-       struct http_hdr_ctx ctx;
-       struct ist hdr;
-       uint32_t data;
-
-       hdr = ist2(be->server_id_hdr_name, be->server_id_hdr_len);
-       htx = htxbuf(&s->req.buf);
-       data = htx->data;
-
-       ctx.blk = NULL;
-       while (http_find_header(htx, hdr, &ctx, 1))
-               http_remove_header(htx, &ctx);
-       http_add_header(htx, hdr, ist2(srv_name, strlen(srv_name)));
-
-       if (co_data(&s->req)) {
-               if (data >= htx->data)
-                       c_rew(&s->req, data - htx->data);
-               else
-                       c_adv(&s->req, htx->data - data);
-       }
-       return 0;
-}
-
 /*
  * In a GET, HEAD or POST request, check if the requested URI matches the stats uri
  * for the current backend.