mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-19 12:10:46 +00:00
MEDIUM: http: http_send_name_header: remove references to msg and buffer
They can be deduced from txn.
This commit is contained in:
parent
3a215bedba
commit
45c0d98769
@ -71,7 +71,7 @@ int http_process_req_common(struct session *s, struct buffer *req, int an_bit, s
|
||||
int http_process_request(struct session *t, struct buffer *req, int an_bit);
|
||||
int http_process_tarpit(struct session *s, struct buffer *req, int an_bit);
|
||||
int http_process_request_body(struct session *s, struct buffer *req, int an_bit);
|
||||
int http_send_name_header(struct http_txn *txn, struct http_msg *msg, struct buffer *buf, struct proxy* be, const char* svr_name);
|
||||
int http_send_name_header(struct http_txn *txn, struct proxy* be, const char* svr_name);
|
||||
int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit);
|
||||
int http_process_res_common(struct session *t, struct buffer *rep, int an_bit, struct proxy *px);
|
||||
int http_request_forward_body(struct session *s, struct buffer *req, int an_bit);
|
||||
|
@ -3665,7 +3665,8 @@ int http_process_request_body(struct session *s, struct buffer *req, int an_bit)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int http_send_name_header(struct http_txn *txn, struct http_msg *msg, struct buffer *buf, struct proxy* be, const char* srv_name) {
|
||||
/* send a server's name with an outgoing request over an established connection */
|
||||
int http_send_name_header(struct http_txn *txn, struct proxy* be, const char* srv_name) {
|
||||
|
||||
struct hdr_ctx ctx;
|
||||
|
||||
@ -3676,9 +3677,9 @@ int http_send_name_header(struct http_txn *txn, struct http_msg *msg, struct buf
|
||||
|
||||
ctx.idx = 0;
|
||||
|
||||
while (http_find_header2(hdr_name, hdr_name_len, buf->p + msg->sol, &txn->hdr_idx, &ctx)) {
|
||||
while (http_find_header2(hdr_name, hdr_name_len, txn->req.buf->p + txn->req.sol, &txn->hdr_idx, &ctx)) {
|
||||
/* remove any existing values from the header */
|
||||
http_remove_header2(msg, buf, &txn->hdr_idx, &ctx);
|
||||
http_remove_header2(&txn->req, txn->req.buf, &txn->hdr_idx, &ctx);
|
||||
}
|
||||
|
||||
/* Add the new header requested with the server value */
|
||||
@ -3688,7 +3689,7 @@ int http_send_name_header(struct http_txn *txn, struct http_msg *msg, struct buf
|
||||
*hdr_val++ = ':';
|
||||
*hdr_val++ = ' ';
|
||||
hdr_val += strlcpy2(hdr_val, srv_name, trash + sizeof(trash) - hdr_val);
|
||||
http_header_add_tail2(buf, msg, &txn->hdr_idx, trash, hdr_val - trash);
|
||||
http_header_add_tail2(txn->req.buf, &txn->req, &txn->hdr_idx, trash, hdr_val - trash);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1954,14 +1954,9 @@ struct task *process_session(struct task *t)
|
||||
/* Now we can add the server name to a header (if requested) */
|
||||
/* check for HTTP mode and proxy server_name_hdr_name != NULL */
|
||||
if ((s->flags & SN_BE_ASSIGNED) &&
|
||||
(s->be->mode == PR_MODE_HTTP) &&
|
||||
(s->be->server_id_hdr_name != NULL)) {
|
||||
|
||||
http_send_name_header(&s->txn,
|
||||
&s->txn.req,
|
||||
s->req,
|
||||
s->be,
|
||||
target_srv(&s->target)->id);
|
||||
(s->be->mode == PR_MODE_HTTP) &&
|
||||
(s->be->server_id_hdr_name != NULL)) {
|
||||
http_send_name_header(&s->txn, s->be, target_srv(&s->target)->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user