From: Willy Tarreau Date: Thu, 10 Apr 2014 09:16:06 +0000 (+0200) Subject: CLEANUP: http: rename http_process_request_body() X-Git-Tag: v1.5-dev23~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a8f947f4ff0cb7e1ceafe466cb1699971498856;p=thirdparty%2Fhaproxy.git CLEANUP: http: rename http_process_request_body() This function does not process anything, it just waits for the beginning of the request body. Let's rename it http_wait_for_request_body(). --- diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h index c836eb446e..1b6284b4e0 100644 --- a/include/proto/proto_http.h +++ b/include/proto/proto_http.h @@ -70,7 +70,7 @@ int http_wait_for_request(struct session *s, struct channel *req, int an_bit); int http_process_req_common(struct session *s, struct channel *req, int an_bit, struct proxy *px); int http_process_request(struct session *t, struct channel *req, int an_bit); int http_process_tarpit(struct session *s, struct channel *req, int an_bit); -int http_process_request_body(struct session *s, struct channel *req, int an_bit); +int http_wait_for_request_body(struct session *s, struct channel *req, int an_bit); 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 channel *rep, int an_bit); int http_process_res_common(struct session *t, struct channel *rep, int an_bit, struct proxy *px); diff --git a/src/proto_http.c b/src/proto_http.c index ccc3ff2f80..93cf033ebe 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -4278,13 +4278,16 @@ int http_process_tarpit(struct session *s, struct channel *req, int an_bit) return 0; } -/* This function is an analyser which processes the HTTP request body. It looks - * for parameters to be used for the load balancing algorithm (url_param). It - * must only be called after the standard HTTP request processing has occurred, - * 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. +/* This function is an analyser which waits for the HTTP request body. It waits + * for either the buffer to be full, or the full advertised contents to have + * reached the buffer. It must only be called after the standard HTTP request + * processing has occurred, because it expects the request to be parsed and will + * look for the Expect header. It may send a 100-Continue interim response. It + * takes in input any state starting from HTTP_MSG_BODY and leaves with one of + * HTTP_MSG_CHK_SIZE, HTTP_MSG_DATA or HTTP_MSG_TRAILERS. 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 channel *req, int an_bit) +int http_wait_for_request_body(struct session *s, struct channel *req, int an_bit) { struct http_txn *txn = &s->txn; struct http_msg *msg = &s->txn.req; diff --git a/src/session.c b/src/session.c index b85f55471b..753d6cc941 100644 --- a/src/session.c +++ b/src/session.c @@ -1897,7 +1897,7 @@ struct task *process_session(struct task *t) } if (ana_list & AN_REQ_HTTP_BODY) { - if (!http_process_request_body(s, s->req, AN_REQ_HTTP_BODY)) + if (!http_wait_for_request_body(s, s->req, AN_REQ_HTTP_BODY)) break; UPDATE_ANALYSERS(s->req->analysers, ana_list, ana_back, AN_REQ_HTTP_BODY); }