mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-24 20:08:01 +00:00
MINOR: http: split initialization
The goal is to export the http txn initialisation functions for using it in the Lua code.
This commit is contained in:
parent
8d16de0ad0
commit
fd50f0bcc8
@ -78,6 +78,8 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
|
|||||||
int http_request_forward_body(struct stream *s, struct channel *req, int an_bit);
|
int http_request_forward_body(struct stream *s, struct channel *req, int an_bit);
|
||||||
int http_response_forward_body(struct stream *s, struct channel *res, int an_bit);
|
int http_response_forward_body(struct stream *s, struct channel *res, int an_bit);
|
||||||
void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx);
|
void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx);
|
||||||
|
void http_txn_reset_req(struct http_txn *txn);
|
||||||
|
void http_txn_reset_res(struct http_txn *txn);
|
||||||
|
|
||||||
void debug_hdr(const char *dir, struct stream *s, const char *start, const char *end);
|
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);
|
int apply_filter_to_req_headers(struct stream *s, struct channel *req, struct hdr_exp *exp);
|
||||||
|
@ -8841,6 +8841,26 @@ struct http_txn *http_alloc_txn(struct stream *s)
|
|||||||
return txn;
|
return txn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void http_txn_reset_req(struct http_txn *txn)
|
||||||
|
{
|
||||||
|
txn->req.flags = 0;
|
||||||
|
txn->req.sol = txn->req.eol = txn->req.eoh = 0; /* relative to the buffer */
|
||||||
|
txn->req.next = 0;
|
||||||
|
txn->req.chunk_len = 0LL;
|
||||||
|
txn->req.body_len = 0LL;
|
||||||
|
txn->req.msg_state = HTTP_MSG_RQBEFORE; /* at the very beginning of the request */
|
||||||
|
}
|
||||||
|
|
||||||
|
void http_txn_reset_res(struct http_txn *txn)
|
||||||
|
{
|
||||||
|
txn->rsp.flags = 0;
|
||||||
|
txn->rsp.sol = txn->rsp.eol = txn->rsp.eoh = 0; /* relative to the buffer */
|
||||||
|
txn->rsp.next = 0;
|
||||||
|
txn->rsp.chunk_len = 0LL;
|
||||||
|
txn->rsp.body_len = 0LL;
|
||||||
|
txn->rsp.msg_state = HTTP_MSG_RPBEFORE; /* at the very beginning of the response */
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize a new HTTP transaction for stream <s>. It is assumed that all
|
* Initialize a new HTTP transaction for stream <s>. It is assumed that all
|
||||||
* the required fields are properly allocated and that we only need to (re)init
|
* the required fields are properly allocated and that we only need to (re)init
|
||||||
@ -8861,18 +8881,9 @@ void http_init_txn(struct stream *s)
|
|||||||
txn->cli_cookie = NULL;
|
txn->cli_cookie = NULL;
|
||||||
txn->uri = NULL;
|
txn->uri = NULL;
|
||||||
|
|
||||||
txn->req.flags = 0;
|
http_txn_reset_req(txn);
|
||||||
txn->req.sol = txn->req.eol = txn->req.eoh = 0; /* relative to the buffer */
|
http_txn_reset_res(txn);
|
||||||
txn->req.next = 0;
|
|
||||||
txn->rsp.flags = 0;
|
|
||||||
txn->rsp.sol = txn->rsp.eol = txn->rsp.eoh = 0; /* relative to the buffer */
|
|
||||||
txn->rsp.next = 0;
|
|
||||||
txn->req.chunk_len = 0LL;
|
|
||||||
txn->req.body_len = 0LL;
|
|
||||||
txn->rsp.chunk_len = 0LL;
|
|
||||||
txn->rsp.body_len = 0LL;
|
|
||||||
txn->req.msg_state = HTTP_MSG_RQBEFORE; /* at the very beginning of the request */
|
|
||||||
txn->rsp.msg_state = HTTP_MSG_RPBEFORE; /* at the very beginning of the response */
|
|
||||||
txn->req.chn = &s->req;
|
txn->req.chn = &s->req;
|
||||||
txn->rsp.chn = &s->res;
|
txn->rsp.chn = &s->res;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user