]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: http: rename http_process_request_body()
authorWilly Tarreau <w@1wt.eu>
Thu, 10 Apr 2014 09:16:06 +0000 (11:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Apr 2014 21:15:27 +0000 (23:15 +0200)
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().

include/proto/proto_http.h
src/proto_http.c
src/session.c

index c836eb446edf1a518815a2afb8b22ec0d7d3e34b..1b6284b4e02ab1569fe5b0096a8bd40abf391c8c 100644 (file)
@@ -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);
index ccc3ff2f8005f18757a95f5cb54ba600ad218934..93cf033ebedeb3c5a6832e9b492e30e8f8ac0b9b 100644 (file)
@@ -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;
index b85f55471b00730a6876270e376deaa2e33441d4..753d6cc9415177b60037248a3cd302cd8633a0cc 100644 (file)
@@ -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);
                                }