int process_cli(struct session *t);
int process_srv_data(struct session *t);
int process_srv_conn(struct session *t);
-int http_wait_for_request(struct session *s, struct buffer *req);
-int http_process_request(struct session *t, struct buffer *req);
-int http_process_tarpit(struct session *s, struct buffer *req);
-int http_process_request_body(struct session *s, struct buffer *req);
+int http_wait_for_request(struct session *s, struct buffer *req, int an_bit);
+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 process_response(struct session *t);
void produce_content(struct session *s, struct buffer *rep);
void tcpv4_add_listener(struct listener *listener);
void tcpv6_add_listener(struct listener *listener);
int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen);
-int tcp_inspect_request(struct session *s, struct buffer *req);
+int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit);
#endif /* _PROTO_PROTO_TCP_H */
* when it has nothing left to do, and may remove any analyser when it wants to
* abort.
*/
-int http_wait_for_request(struct session *s, struct buffer *req)
+int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
{
/*
* We will parse the partial (or complete) lines.
txn->req.cap, s->fe->req_cap);
/* end of job, return OK */
- req->analysers &= ~AN_REQ_WAIT_HTTP;
+ req->analysers &= ~an_bit;
req->analyse_exp = TICK_ETERNITY;
return 1;
* needs more data, encounters an error, or wants to immediately abort the
* request. It relies on buffers flags, and updates s->req->analysers.
*/
-int http_process_request(struct session *s, struct buffer *req)
+int http_process_request(struct session *s, struct buffer *req, int an_bit)
{
int cur_idx;
struct http_txn *txn = &s->txn;
struct http_msg *msg = &txn->req;
struct proxy *cur_proxy;
- req->analysers &= ~AN_REQ_HTTP_HDR;
+ req->analysers &= ~an_bit;
req->analyse_exp = TICK_ETERNITY;
DPRINTF(stderr,"[%u] %s: session=%p b=%p, exp(r,w)=%u,%u bf=%08x bl=%d analysers=%02x\n",
* returns zero, at the beginning because it prevents any other processing
* from occurring, and at the end because it terminates the request.
*/
-int http_process_tarpit(struct session *s, struct buffer *req)
+int http_process_tarpit(struct session *s, struct buffer *req, int an_bit)
{
struct http_txn *txn = &s->txn;
* because it expects the request to be parsed. It returns zero if it needs to
* read more data, or 1 once it has completed its analysis.
*/
-int http_process_request_body(struct session *s, struct buffer *req)
+int http_process_request_body(struct session *s, struct buffer *req, int an_bit)
{
struct http_msg *msg = &s->txn.req;
unsigned long body = msg->sol[msg->eoh] == '\r' ? msg->eoh + 2 : msg->eoh + 1;
tick_is_expired(req->analyse_exp, now_ms)) {
/* The situation will not evolve, so let's give up on the analysis. */
s->logs.tv_request = now; /* update the request timer to reflect full request */
- req->analysers &= ~AN_REQ_HTTP_BODY;
+ req->analysers &= ~an_bit;
req->analyse_exp = TICK_ETERNITY;
return 1;
}
* called after XXX bytes have been received (or transfered), and the min of
* all's wishes will be used to ring back (unless a special condition occurs).
*/
-int tcp_inspect_request(struct session *s, struct buffer *req)
+int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit)
{
struct tcp_rule *rule;
int partial;
/* if we get there, it means we have no rule which matches, or
* we have an explicit accept, so we apply the default accept.
*/
- req->analysers &= ~AN_REQ_INSPECT;
+ req->analysers &= ~an_bit;
req->analyse_exp = TICK_ETERNITY;
return 1;
}
* STATS_ST_CLOSE. It removes the AN_REQ_UNIX_STATS bit from req->analysers
* once done. It always returns 0.
*/
-int uxst_req_analyser_stats(struct session *s, struct buffer *req)
+int uxst_req_analyser_stats(struct session *s, struct buffer *req, int an_bit)
{
char *line, *p;
case STATS_ST_CLOSE:
/* end of dump */
- s->req->analysers &= ~AN_REQ_UNIX_STATS;
+ s->req->analysers &= ~an_bit;
s->ana_state = 0;
break;
}
*/
while (s->req->analysers) {
if (s->req->analysers & AN_REQ_UNIX_STATS)
- if (!uxst_req_analyser_stats(s, s->req))
+ if (!uxst_req_analyser_stats(s, s->req, AN_REQ_UNIX_STATS))
break;
/* Just make sure that nobody set a wrong flag causing an endless loop */
if (s->req->analysers & AN_REQ_INSPECT) {
last_ana |= AN_REQ_INSPECT;
- if (!tcp_inspect_request(s, s->req))
+ if (!tcp_inspect_request(s, s->req, AN_REQ_INSPECT))
break;
}
if (s->req->analysers & AN_REQ_WAIT_HTTP) {
last_ana |= AN_REQ_WAIT_HTTP;
- if (!http_wait_for_request(s, s->req))
+ if (!http_wait_for_request(s, s->req, AN_REQ_WAIT_HTTP))
break;
}
if (s->req->analysers & AN_REQ_HTTP_HDR) {
last_ana |= AN_REQ_HTTP_HDR;
- if (!http_process_request(s, s->req))
+ if (!http_process_request(s, s->req, AN_REQ_HTTP_HDR))
break;
}
if (s->req->analysers & AN_REQ_HTTP_TARPIT) {
last_ana |= AN_REQ_HTTP_TARPIT;
- if (!http_process_tarpit(s, s->req))
+ if (!http_process_tarpit(s, s->req, AN_REQ_HTTP_TARPIT))
break;
}
if (s->req->analysers & AN_REQ_HTTP_BODY) {
last_ana |= AN_REQ_HTTP_BODY;
- if (!http_process_request_body(s, s->req))
+ if (!http_process_request_body(s, s->req, AN_REQ_HTTP_BODY))
break;
}
}