]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CLEANUP] buffer_flush() was misleading, rename it as buffer_erase
authorWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2009 19:33:29 +0000 (20:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2009 19:33:29 +0000 (20:33 +0100)
include/proto/buffers.h
src/proto_http.c
src/stream_interface.c

index 6b5771b6ab6263f6435c4825fb58453fc3a1b629..eab24f6a5af5225e278812813d6103c81f6249b2 100644 (file)
@@ -108,11 +108,11 @@ static inline void buffer_forward(struct buffer *buf, unsigned int bytes)
        buf->send_max += data_left;
 }
 
-/* Flush any content from buffer <buf> and adjusts flags accordingly. Note
+/* Erase any content from buffer <buf> and adjusts flags accordingly. Note
  * that any spliced data is not affected since we may not have any access to
  * it.
  */
-static inline void buffer_flush(struct buffer *buf)
+static inline void buffer_erase(struct buffer *buf)
 {
        buf->send_max = 0;
        buf->to_forward = 0;
index 52042844190afbba42e630e4841cb3352b23ac78..0384996deacd3487190ed00988a8cdd2a2492e7d 100644 (file)
@@ -540,13 +540,13 @@ int http_find_header(const char *name,
  * stream interface is assumed to be already in a closed state. An optional
  * message is copied into the input buffer, and an HTTP status code stored.
  * The error flags are set to the values in arguments. Any pending request
- * is flushed.
+ * in this buffer will be lost.
  */
 static void http_server_error(struct session *t, struct stream_interface *si,
                              int err, int finst, int status, const struct chunk *msg)
 {
-       buffer_flush(si->ob);
-       buffer_flush(si->ib);
+       buffer_erase(si->ob);
+       buffer_erase(si->ib);
        buffer_write_ena(si->ib);
        if (status > 0 && msg) {
                t->txn.status = status;
@@ -2304,8 +2304,8 @@ int http_process_request(struct session *s, struct buffer *req)
         * eventually expire. We build the tarpit as an analyser.
         */
        if (txn->flags & TX_CLTARPIT) {
-               buffer_flush(s->req);
-               /* flush the request so that we can drop the connection early
+               buffer_erase(s->req);
+               /* wipe the request out so that we can drop the connection early
                 * if the client closes first.
                 */
                buffer_write_dis(req);
index c7f9b43e376979cdf7be2b8fccba963faacc2ee3..c0c80b6e135c3341302a7ef32f63243ca9c7d0ec 100644 (file)
@@ -59,14 +59,14 @@ void stream_int_report_error(struct stream_interface *si)
 }
 
 /*
- * Returns a message into the output buffer, and flushes the input buffer. The
- * output buffer doesn't need to be empty before this. The message is contained
- * in a "chunk". If it is null, then an empty message is used.
+ * Erase any content from input and output buffers, and return a message into
+ * the output buffer. The message is provided as a "chunk". If it is null,
+ * then an empty message is used.
  */
 void stream_int_return(struct stream_interface *si, const struct chunk *msg)
 {
-       buffer_flush(si->ib);
-       buffer_flush(si->ob);
+       buffer_erase(si->ib);
+       buffer_erase(si->ob);
        if (msg && msg->len)
                buffer_write(si->ob, msg->str, msg->len);
 }
@@ -83,7 +83,7 @@ void stream_int_return(struct stream_interface *si, const struct chunk *msg)
 void stream_int_retnclose(struct stream_interface *si, const struct chunk *msg)
 {
        buffer_abort(si->ib);
-       buffer_flush(si->ob);
+       buffer_erase(si->ob);
        buffer_shutr_now(si->ob);
        if (msg && msg->len)
                buffer_write(si->ob, msg->str, msg->len);