]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG/MAJOR: use "struct channel" instead of "struct buffer"
authorWilly Tarreau <wtarreau@exceliance.fr>
Mon, 2 Jul 2012 13:11:27 +0000 (15:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Sep 2012 19:54:55 +0000 (21:54 +0200)
This is a massive rename. We'll then split channel and buffer.

This change needs a lot of cleanups. At many locations, the parameter
or variable is still called "buf" which will become ambiguous. Also,
the "struct channel" is still defined in buffers.h.

19 files changed:
include/proto/backend.h
include/proto/buffers.h
include/proto/frontend.h
include/proto/proto_http.h
include/proto/proto_tcp.h
include/types/buffers.h
include/types/proto_http.h
include/types/session.h
include/types/stream_interface.h
src/acl.c
src/backend.c
src/buffers.c
src/dumpstats.c
src/frontend.c
src/proto_http.c
src/proto_tcp.c
src/session.c
src/sock_raw.c
src/stream_interface.c

index 24cd9093625aaf94820b718cf1ba5c56aff5f652..74caaaac1f6cdc85cf736848ca048157cc4931a7 100644 (file)
@@ -36,7 +36,7 @@ int connect_server(struct session *s);
 int srv_redispatch_connect(struct session *t);
 const char *backend_lb_algo_str(int algo);
 int backend_parse_balance(const char **args, char **err, struct proxy *curproxy);
-int tcp_persist_rdp_cookie(struct session *s, struct buffer *req, int an_bit);
+int tcp_persist_rdp_cookie(struct session *s, struct channel *req, int an_bit);
 
 int be_downtime(struct proxy *px);
 void recount_servers(struct proxy *px);
index 80f43ae4a694da92109090ae3a9175fd2e026f05..4bc79ba51ec436c619b8295fa9a58622667b6b60 100644 (file)
@@ -40,20 +40,20 @@ extern struct pool_head *pool2_buffer;
 int init_buffer();
 
 /* SI-to-buffer functions : buffer_{get,put}_{char,block,string,chunk} */
-int bo_inject(struct buffer *buf, const char *msg, int len);
-int bi_putblk(struct buffer *buf, const char *str, int len);
-int bi_putchr(struct buffer *buf, char c);
-int bo_getline(struct buffer *buf, char *str, int len);
-int bo_getblk(struct buffer *buf, char *blk, int len, int offset);
-int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int len);
-int buffer_insert_line2(struct buffer *b, char *pos, const char *str, int len);
-void buffer_dump(FILE *o, struct buffer *b, int from, int to);
-void buffer_slow_realign(struct buffer *buf);
-void buffer_bounce_realign(struct buffer *buf);
-unsigned long long buffer_forward(struct buffer *buf, unsigned long long bytes);
+int bo_inject(struct channel *buf, const char *msg, int len);
+int bi_putblk(struct channel *buf, const char *str, int len);
+int bi_putchr(struct channel *buf, char c);
+int bo_getline(struct channel *buf, char *str, int len);
+int bo_getblk(struct channel *buf, char *blk, int len, int offset);
+int buffer_replace2(struct channel *b, char *pos, char *end, const char *str, int len);
+int buffer_insert_line2(struct channel *b, char *pos, const char *str, int len);
+void buffer_dump(FILE *o, struct channel *b, int from, int to);
+void buffer_slow_realign(struct channel *buf);
+void buffer_bounce_realign(struct channel *buf);
+unsigned long long buffer_forward(struct channel *buf, unsigned long long bytes);
 
 /* Initialize all fields in the buffer. The BF_OUT_EMPTY flags is set. */
-static inline void buffer_init(struct buffer *buf)
+static inline void buffer_init(struct channel *buf)
 {
        buf->o = 0;
        buf->i = 0;
@@ -86,7 +86,7 @@ static inline void buffer_init(struct buffer *buf)
        })
 
 /* Returns the start of the input data in a buffer */
-static inline char *bi_ptr(const struct buffer *b)
+static inline char *bi_ptr(const struct channel *b)
 {
        return b->p;
 }
@@ -94,7 +94,7 @@ static inline char *bi_ptr(const struct buffer *b)
 /* Returns the end of the input data in a buffer (pointer to next
  * insertion point).
  */
-static inline char *bi_end(const struct buffer *b)
+static inline char *bi_end(const struct channel *b)
 {
        char *ret = b->p + b->i;
 
@@ -104,7 +104,7 @@ static inline char *bi_end(const struct buffer *b)
 }
 
 /* Returns the amount of input data that can contiguously be read at once */
-static inline int bi_contig_data(const struct buffer *b)
+static inline int bi_contig_data(const struct channel *b)
 {
        int data = b->data + b->size - b->p;
 
@@ -114,7 +114,7 @@ static inline int bi_contig_data(const struct buffer *b)
 }
 
 /* Returns the start of the output data in a buffer */
-static inline char *bo_ptr(const struct buffer *b)
+static inline char *bo_ptr(const struct channel *b)
 {
        char *ret = b->p - b->o;
 
@@ -124,13 +124,13 @@ static inline char *bo_ptr(const struct buffer *b)
 }
 
 /* Returns the end of the output data in a buffer */
-static inline char *bo_end(const struct buffer *b)
+static inline char *bo_end(const struct channel *b)
 {
        return b->p;
 }
 
 /* Returns the amount of output data that can contiguously be read at once */
-static inline int bo_contig_data(const struct buffer *b)
+static inline int bo_contig_data(const struct channel *b)
 {
        char *beg = b->p - b->o;
 
@@ -140,25 +140,25 @@ static inline int bo_contig_data(const struct buffer *b)
 }
 
 /* Return the buffer's length in bytes by summing the input and the output */
-static inline int buffer_len(const struct buffer *buf)
+static inline int buffer_len(const struct channel *buf)
 {
        return buf->i + buf->o;
 }
 
 /* Return non-zero only if the buffer is not empty */
-static inline int buffer_not_empty(const struct buffer *buf)
+static inline int buffer_not_empty(const struct channel *buf)
 {
        return buf->i | buf->o;
 }
 
 /* Return non-zero only if the buffer is empty */
-static inline int buffer_empty(const struct buffer *buf)
+static inline int buffer_empty(const struct channel *buf)
 {
        return !buffer_not_empty(buf);
 }
 
 /* Normalizes a pointer after a subtract */
-static inline char *buffer_wrap_sub(const struct buffer *buf, char *ptr)
+static inline char *buffer_wrap_sub(const struct channel *buf, char *ptr)
 {
        if (ptr < buf->data)
                ptr += buf->size;
@@ -166,7 +166,7 @@ static inline char *buffer_wrap_sub(const struct buffer *buf, char *ptr)
 }
 
 /* Normalizes a pointer after an addition */
-static inline char *buffer_wrap_add(const struct buffer *buf, char *ptr)
+static inline char *buffer_wrap_add(const struct channel *buf, char *ptr)
 {
        if (ptr - buf->size >= buf->data)
                ptr -= buf->size;
@@ -178,7 +178,7 @@ static inline char *buffer_wrap_add(const struct buffer *buf, char *ptr)
  * bytes free. The result is between 0 and global.maxrewrite, which is itself
  * smaller than any buf->size.
  */
-static inline int buffer_reserved(const struct buffer *buf)
+static inline int buffer_reserved(const struct channel *buf)
 {
        int ret = global.tune.maxrewrite - buf->to_forward - buf->o;
 
@@ -193,7 +193,7 @@ static inline int buffer_reserved(const struct buffer *buf)
  * pending bytes are forwarded, the buffer still has global.tune.maxrewrite
  * bytes free. The result sits between buf->size - maxrewrite and buf->size.
  */
-static inline int buffer_max_len(const struct buffer *buf)
+static inline int buffer_max_len(const struct channel *buf)
 {
        return buf->size - buffer_reserved(buf);
 }
@@ -203,7 +203,7 @@ static inline int buffer_max_len(const struct buffer *buf)
  * close to happen. The test is optimized to avoid as many operations as
  * possible for the fast case and to be used as an "if" condition.
  */
-static inline int bi_full(const struct buffer *b)
+static inline int bi_full(const struct channel *b)
 {
        int rem = b->size;
 
@@ -228,7 +228,7 @@ static inline int bi_full(const struct buffer *b)
  * is close to happen. The test is optimized to avoid as many operations as
  * possible for the fast case.
  */
-static inline int bi_avail(const struct buffer *b)
+static inline int bi_avail(const struct channel *b)
 {
        int rem = b->size;
        int rem2;
@@ -257,7 +257,7 @@ static inline int bi_avail(const struct buffer *b)
 /* Return the maximum amount of bytes that can be written into the buffer,
  * including reserved space which may be overwritten.
  */
-static inline int buffer_total_space(const struct buffer *buf)
+static inline int buffer_total_space(const struct channel *buf)
 {
        return buf->size - buffer_len(buf);
 }
@@ -266,7 +266,7 @@ static inline int buffer_total_space(const struct buffer *buf)
  * and enforces a limit on buf->data + buf->size. <start> must be within the
  * buffer.
  */
-static inline int buffer_contig_area(const struct buffer *buf, const char *start, int count)
+static inline int buffer_contig_area(const struct channel *buf, const char *start, int count)
 {
        if (count > buf->data - start + buf->size)
                count = buf->data - start + buf->size;
@@ -276,7 +276,7 @@ static inline int buffer_contig_area(const struct buffer *buf, const char *start
 /* Return the amount of bytes that can be written into the buffer at once,
  * including reserved space which may be overwritten.
  */
-static inline int buffer_contig_space(const struct buffer *buf)
+static inline int buffer_contig_space(const struct channel *buf)
 {
        const char *left, *right;
 
@@ -294,7 +294,7 @@ static inline int buffer_contig_space(const struct buffer *buf)
  * to out. The caller is responsible for ensuring that adv is always
  * smaller than or equal to b->i. The BF_OUT_EMPTY flag is updated.
  */
-static inline void b_adv(struct buffer *b, unsigned int adv)
+static inline void b_adv(struct channel *b, unsigned int adv)
 {
        b->i -= adv;
        b->o += adv;
@@ -307,7 +307,7 @@ static inline void b_adv(struct buffer *b, unsigned int adv)
  * backwards, and that as many bytes from out are moved to in. The caller is
  * responsible for ensuring that adv is always smaller than or equal to b->o.
  */
-static inline void b_rew(struct buffer *b, unsigned int adv)
+static inline void b_rew(struct channel *b, unsigned int adv)
 {
        b->i += adv;
        b->o -= adv;
@@ -320,7 +320,7 @@ static inline void b_rew(struct buffer *b, unsigned int adv)
  * excluding the amount of reserved space passed in <res>, which is
  * preserved.
  */
-static inline int buffer_contig_space_with_res(const struct buffer *buf, int res)
+static inline int buffer_contig_space_with_res(const struct channel *buf, int res)
 {
        /* Proceed differently if the buffer is full, partially used or empty.
         * The hard situation is when it's partially used and either data or
@@ -342,7 +342,7 @@ static inline int buffer_contig_space_with_res(const struct buffer *buf, int res
 /* Return the amount of bytes that can be written into the buffer at once,
  * excluding reserved space, which is preserved.
  */
-static inline int buffer_contig_space_res(const struct buffer *buf)
+static inline int buffer_contig_space_res(const struct channel *buf)
 {
        return buffer_contig_space_with_res(buf, buffer_reserved(buf));
 }
@@ -353,7 +353,7 @@ static inline int buffer_contig_space_res(const struct buffer *buf)
  * once, so the original pointer must be between ->data-size and ->data+2*size-1,
  * otherwise an invalid pointer might be returned.
  */
-static inline const char *buffer_pointer(const struct buffer *buf, const char *ptr)
+static inline const char *buffer_pointer(const struct channel *buf, const char *ptr)
 {
        if (ptr < buf->data)
                ptr += buf->size;
@@ -365,7 +365,7 @@ static inline const char *buffer_pointer(const struct buffer *buf, const char *p
 /* Returns the distance between two pointers, taking into account the ability
  * to wrap around the buffer's end.
  */
-static inline int buffer_count(const struct buffer *buf, const char *from, const char *to)
+static inline int buffer_count(const struct channel *buf, const char *from, const char *to)
 {
        int count = to - from;
        if (count < 0)
@@ -376,7 +376,7 @@ static inline int buffer_count(const struct buffer *buf, const char *from, const
 /* returns the amount of pending bytes in the buffer. It is the amount of bytes
  * that is not scheduled to be sent.
  */
-static inline int buffer_pending(const struct buffer *buf)
+static inline int buffer_pending(const struct channel *buf)
 {
        return buf->i;
 }
@@ -387,7 +387,7 @@ static inline int buffer_pending(const struct buffer *buf)
  * <end>. It always starts at buf->p. The work area includes the
  * reserved area.
  */
-static inline int buffer_work_area(const struct buffer *buf, const char *end)
+static inline int buffer_work_area(const struct channel *buf, const char *end)
 {
        end = buffer_pointer(buf, end);
        if (end == buffer_wrap_add(buf, buf->p + buf->i))
@@ -397,7 +397,7 @@ static inline int buffer_work_area(const struct buffer *buf, const char *end)
 }
 
 /* Return 1 if the buffer has less than 1/4 of its capacity free, otherwise 0 */
-static inline int buffer_almost_full(const struct buffer *buf)
+static inline int buffer_almost_full(const struct channel *buf)
 {
        if (buffer_total_space(buf) < buf->size / 4)
                return 1;
@@ -405,13 +405,13 @@ static inline int buffer_almost_full(const struct buffer *buf)
 }
 
 /* Returns true if the buffer's input is already closed */
-static inline int buffer_input_closed(struct buffer *buf)
+static inline int buffer_input_closed(struct channel *buf)
 {
        return ((buf->flags & BF_SHUTR) != 0);
 }
 
 /* Returns true if the buffer's output is already closed */
-static inline int buffer_output_closed(struct buffer *buf)
+static inline int buffer_output_closed(struct channel *buf)
 {
        return ((buf->flags & BF_SHUTW) != 0);
 }
@@ -422,7 +422,7 @@ static inline int buffer_output_closed(struct buffer *buf)
  * That way, we don't have to update the timeout on every I/O. Note that the
  * analyser timeout is always checked.
  */
-static inline void buffer_check_timeouts(struct buffer *b)
+static inline void buffer_check_timeouts(struct channel *b)
 {
        if (likely(!(b->flags & (BF_SHUTR|BF_READ_TIMEOUT|BF_READ_ACTIVITY|BF_READ_NOEXP))) &&
            unlikely(tick_is_expired(b->rex, now_ms)))
@@ -441,7 +441,7 @@ static inline void buffer_check_timeouts(struct buffer *b)
  * already covers those data. That permits doing a flush even after a forward,
  * although not recommended.
  */
-static inline void buffer_flush(struct buffer *buf)
+static inline void buffer_flush(struct channel *buf)
 {
        buf->p = buffer_wrap_add(buf, buf->p + buf->i);
        buf->o += buf->i;
@@ -454,7 +454,7 @@ static inline void buffer_flush(struct buffer *buf)
  * that any spliced data is not affected since we may not have any access to
  * it.
  */
-static inline void buffer_erase(struct buffer *buf)
+static inline void buffer_erase(struct channel *buf)
 {
        buf->o = 0;
        buf->i = 0;
@@ -470,7 +470,7 @@ static inline void buffer_erase(struct buffer *buf)
  * stopped. This is mainly to be used to send error messages after existing
  * data.
  */
-static inline void bi_erase(struct buffer *buf)
+static inline void bi_erase(struct channel *buf)
 {
        if (!buf->o)
                return buffer_erase(buf);
@@ -491,26 +491,26 @@ static inline void bi_erase(struct buffer *buf)
  * This is mainly used to remove empty lines at the beginning of a request
  * or a response.
  */
-static inline void bi_fast_delete(struct buffer *buf, int n)
+static inline void bi_fast_delete(struct channel *buf, int n)
 {
        buf->i -= n;
        buf->p += n;
 }
 
 /* marks the buffer as "shutdown" ASAP for reads */
-static inline void buffer_shutr_now(struct buffer *buf)
+static inline void buffer_shutr_now(struct channel *buf)
 {
        buf->flags |= BF_SHUTR_NOW;
 }
 
 /* marks the buffer as "shutdown" ASAP for writes */
-static inline void buffer_shutw_now(struct buffer *buf)
+static inline void buffer_shutw_now(struct channel *buf)
 {
        buf->flags |= BF_SHUTW_NOW;
 }
 
 /* marks the buffer as "shutdown" ASAP in both directions */
-static inline void buffer_abort(struct buffer *buf)
+static inline void buffer_abort(struct channel *buf)
 {
        buf->flags |= BF_SHUTR_NOW | BF_SHUTW_NOW;
        buf->flags &= ~BF_AUTO_CONNECT;
@@ -522,8 +522,8 @@ static inline void buffer_abort(struct buffer *buf)
  * during this first call.
  */
 static inline void buffer_install_hijacker(struct session *s,
-                                          struct buffer *b,
-                                          void (*func)(struct session *, struct buffer *))
+                                          struct channel *b,
+                                          void (*func)(struct session *, struct channel *))
 {
        b->hijacker = func;
        b->flags |= BF_HIJACK;
@@ -531,13 +531,13 @@ static inline void buffer_install_hijacker(struct session *s,
 }
 
 /* Releases the buffer from hijacking mode. Often used by the hijack function */
-static inline void buffer_stop_hijack(struct buffer *buf)
+static inline void buffer_stop_hijack(struct channel *buf)
 {
        buf->flags &= ~BF_HIJACK;
 }
 
 /* allow the consumer to try to establish a new connection. */
-static inline void buffer_auto_connect(struct buffer *buf)
+static inline void buffer_auto_connect(struct channel *buf)
 {
        buf->flags |= BF_AUTO_CONNECT;
 }
@@ -545,31 +545,31 @@ static inline void buffer_auto_connect(struct buffer *buf)
 /* prevent the consumer from trying to establish a new connection, and also
  * disable auto shutdown forwarding.
  */
-static inline void buffer_dont_connect(struct buffer *buf)
+static inline void buffer_dont_connect(struct channel *buf)
 {
        buf->flags &= ~(BF_AUTO_CONNECT|BF_AUTO_CLOSE);
 }
 
 /* allow the producer to forward shutdown requests */
-static inline void buffer_auto_close(struct buffer *buf)
+static inline void buffer_auto_close(struct channel *buf)
 {
        buf->flags |= BF_AUTO_CLOSE;
 }
 
 /* prevent the producer from forwarding shutdown requests */
-static inline void buffer_dont_close(struct buffer *buf)
+static inline void buffer_dont_close(struct channel *buf)
 {
        buf->flags &= ~BF_AUTO_CLOSE;
 }
 
 /* allow the producer to read / poll the input */
-static inline void buffer_auto_read(struct buffer *buf)
+static inline void buffer_auto_read(struct channel *buf)
 {
        buf->flags &= ~BF_DONT_READ;
 }
 
 /* prevent the producer from read / poll the input */
-static inline void buffer_dont_read(struct buffer *buf)
+static inline void buffer_dont_read(struct channel *buf)
 {
        buf->flags |= BF_DONT_READ;
 }
@@ -578,7 +578,7 @@ static inline void buffer_dont_read(struct buffer *buf)
  * Tries to realign the given buffer, and returns how many bytes can be written
  * there at once without overwriting anything.
  */
-static inline int buffer_realign(struct buffer *buf)
+static inline int buffer_realign(struct channel *buf)
 {
        if (!(buf->i | buf->o)) {
                /* let's realign the buffer to optimize I/O */
@@ -593,7 +593,7 @@ static inline int buffer_realign(struct buffer *buf)
  * with <len> causing a wrapping at the end of the buffer. It's the caller's
  * responsibility to ensure that <len> is never larger than buf->o.
  */
-static inline void bo_skip(struct buffer *buf, int len)
+static inline void bo_skip(struct channel *buf, int len)
 {
        buf->o -= len;
        if (!buf->o && !buf->pipe)
@@ -617,7 +617,7 @@ static inline void bo_skip(struct buffer *buf, int len)
  * Buffer flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
  * transferred. The chunk's length is updated with the number of bytes sent.
  */
-static inline int bi_putchk(struct buffer *buf, struct chunk *chunk)
+static inline int bi_putchk(struct channel *buf, struct chunk *chunk)
 {
        int ret;
 
@@ -635,7 +635,7 @@ static inline int bi_putchk(struct buffer *buf, struct chunk *chunk)
  * Buffer flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
  * transferred.
  */
-static inline int bi_putstr(struct buffer *buf, const char *str)
+static inline int bi_putstr(struct channel *buf, const char *str)
 {
        return bi_putblk(buf, str, strlen(str));
 }
@@ -646,7 +646,7 @@ static inline int bi_putstr(struct buffer *buf, const char *str)
  * it's up to the caller to call bo_skip(buf, 1) when it has consumed the char.
  * Also note that this function respects the ->o limit.
  */
-static inline int bo_getchr(struct buffer *buf)
+static inline int bo_getchr(struct channel *buf)
 {
        /* closed or empty + imminent close = -2; empty = -1 */
        if (unlikely(buf->flags & (BF_OUT_EMPTY|BF_SHUTW))) {
@@ -664,7 +664,7 @@ static inline int bo_getchr(struct buffer *buf)
  * not done. The function does not adjust ->o nor BF_OUT_EMPTY because
  * it does not make sense to use it on data scheduled to be sent.
  */
-static inline int buffer_replace(struct buffer *b, char *pos, char *end, const char *str)
+static inline int buffer_replace(struct channel *b, char *pos, char *end, const char *str)
 {
        return buffer_replace2(b, pos, end, str, strlen(str));
 }
index a80f9bd643aa7410ebb48ae7405479387b168e0e..3f67d4f36bb6699a78049e8e0bda0b302bc51af0 100644 (file)
@@ -26,7 +26,7 @@
 #include <types/session.h>
 
 int frontend_accept(struct session *s);
-int frontend_decode_proxy_request(struct session *s, struct buffer *req, int an_bit);
+int frontend_decode_proxy_request(struct session *s, struct channel *req, int an_bit);
 int make_proxy_line(char *buf, int buf_len, struct sockaddr_storage *src, struct sockaddr_storage *dst);
 
 
index 06fe292574583f8bc7b2ac742d5e313b2652d946..69d932c49710c9396cad3f414fc2da540d351b51 100644 (file)
@@ -66,27 +66,27 @@ int event_accept(int fd);
 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 an_bit);
-int http_process_req_common(struct session *s, struct buffer *req, int an_bit, struct proxy *px);
-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 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_send_name_header(struct http_txn *txn, struct proxy* be, const char* svr_name);
-int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit);
-int http_process_res_common(struct session *t, struct buffer *rep, int an_bit, struct proxy *px);
-int http_request_forward_body(struct session *s, struct buffer *req, int an_bit);
-int http_response_forward_body(struct session *s, struct buffer *res, int an_bit);
+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);
+int http_request_forward_body(struct session *s, struct channel *req, int an_bit);
+int http_response_forward_body(struct session *s, struct channel *res, int an_bit);
 
 void debug_hdr(const char *dir, struct session *t, const char *start, const char *end);
 void get_srv_from_appsession(struct session *t, const char *begin, int len);
-int apply_filter_to_req_headers(struct session *t, struct buffer *req, struct hdr_exp *exp);
-int apply_filter_to_req_line(struct session *t, struct buffer *req, struct hdr_exp *exp);
-int apply_filters_to_request(struct session *s, struct buffer *req, struct proxy *px);
-int apply_filters_to_response(struct session *t, struct buffer *rtr, struct proxy *px);
+int apply_filter_to_req_headers(struct session *t, struct channel *req, struct hdr_exp *exp);
+int apply_filter_to_req_line(struct session *t, struct channel *req, struct hdr_exp *exp);
+int apply_filters_to_request(struct session *s, struct channel *req, struct proxy *px);
+int apply_filters_to_response(struct session *t, struct channel *rtr, struct proxy *px);
 void manage_client_side_appsession(struct session *t, const char *buf, int len);
-void manage_client_side_cookies(struct session *t, struct buffer *req);
-void manage_server_side_cookies(struct session *t, struct buffer *rtr);
-void check_response_for_cacheability(struct session *t, struct buffer *rtr);
+void manage_client_side_cookies(struct session *t, struct channel *req);
+void manage_server_side_cookies(struct session *t, struct channel *rtr);
+void check_response_for_cacheability(struct session *t, struct channel *rtr);
 int stats_check_uri(struct stream_interface *si, struct http_txn *txn, struct proxy *backend);
 void init_proto_http();
 int http_find_header2(const char *name, int len,
index 6a60121d2191652c3ff7f37d3b6cbd8eac09e125..6aadb5ae22814b3ee67a86c88a7fc3846d9a6cb1 100644 (file)
@@ -34,8 +34,8 @@ int tcp_connect_server(struct stream_interface *si);
 int tcp_connect_probe(struct connection *conn);
 int tcp_get_src(int fd, struct sockaddr *sa, socklen_t salen, int dir);
 int tcp_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir);
-int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit);
-int tcp_inspect_response(struct session *s, struct buffer *rep, int an_bit);
+int tcp_inspect_request(struct session *s, struct channel *req, int an_bit);
+int tcp_inspect_response(struct session *s, struct channel *rep, int an_bit);
 int tcp_exec_req_rules(struct session *s);
 int smp_fetch_rdp_cookie(struct proxy *px, struct session *l4, void *l7, unsigned int opt, const struct arg *args, struct sample *smp);
 
index ab56129125f2b3ae0c345fcc8d50d6f29140156a..68b4319c5207ea9f639c93c2eb0f6293b7d2a130 100644 (file)
@@ -27,7 +27,7 @@
 #include <types/stream_interface.h>
 
 /* The BF_* macros designate Buffer Flags, which may be ORed in the bit field
- * member 'flags' in struct buffer. Here we have several types of flags :
+ * member 'flags' in struct channel. Here we have several types of flags :
  *
  *   - pure status flags, reported by the lower layer, which must be cleared
  *     before doing further I/O :
@@ -174,7 +174,7 @@ struct chunk {
 /* needed for a declaration below */
 struct session;
 
-struct buffer {
+struct channel {
        unsigned int flags;             /* BF_* */
        int rex;                        /* expiration date for a read, in ticks */
        int wex;                        /* expiration date for a write or connect, in ticks */
@@ -187,7 +187,7 @@ struct buffer {
        unsigned int to_forward;        /* number of bytes to forward after out without a wake-up */
        unsigned int analysers;         /* bit field indicating what to do on the buffer */
        int analyse_exp;                /* expiration date for current analysers (if set) */
-       void (*hijacker)(struct session *, struct buffer *); /* alternative content producer */
+       void (*hijacker)(struct session *, struct channel *); /* alternative content producer */
        unsigned char xfer_large;       /* number of consecutive large xfers */
        unsigned char xfer_small;       /* number of consecutive small xfers */
        unsigned long long total;       /* total data read */
index 76c8e6b5062eaf7777093f733f97d90976c6d2b4..158f0948d51a6a11fc6b9407decaff554f5db935 100644 (file)
@@ -305,7 +305,7 @@ enum {
 struct http_msg {
        unsigned int msg_state;                /* where we are in the current message parsing */
        unsigned int flags;                    /* flags describing the message (HTTP version, ...) */
-       struct buffer *buf;                    /* pointer to the buffer which holds the message */
+       struct channel *buf;                   /* pointer to the buffer which holds the message */
        unsigned int next;                     /* pointer to next byte to parse, relative to buf->p */
        unsigned int sov;                      /* current header: start of value */
        unsigned int eoh;                      /* End Of Headers, relative to buffer */
index a0980028ce31b9e3917febb5f9ea625dfeaf0a37..9180a94b57d7e70078aa2bb22e710e882fc4e130 100644 (file)
@@ -169,8 +169,8 @@ struct session {
        struct proxy *be;                       /* the proxy this session depends on for the server side */
        int flags;                              /* some flags describing the session */
        unsigned term_trace;                    /* term trace: 4*8 bits indicating which part of the code closed */
-       struct buffer *req;                     /* request buffer */
-       struct buffer *rep;                     /* response buffer */
+       struct channel *req;                    /* request buffer */
+       struct channel *rep;                    /* response buffer */
        struct stream_interface si[2];          /* client and server stream interfaces */
        struct server *srv_conn;                /* session already has a slot on a server and is not in queue */
        struct target target;                   /* target to use for this session */
index e181d570c4087d24eb91c3dc12521557edd25136..1a75c8d45bcd1e0efddd20556520933dc2fdce81 100644 (file)
@@ -136,7 +136,7 @@ struct stream_interface {
        unsigned int state;     /* SI_ST* */
        unsigned int prev_state;/* SI_ST*, copy of previous state */
        unsigned int flags;     /* SI_FL_* */
-       struct buffer *ib, *ob; /* input and output buffers */
+       struct channel *ib, *ob; /* input and output buffers */
        unsigned int exp;       /* wake up time for connect, queue, turn-around, ... */
        void *owner;            /* generally a (struct task*) */
        unsigned int err_type;  /* first error detected, one of SI_ET_* */
index e2e72ceb6a1c75e33e3c4cf6469f0947d1a66995..b4c5908fc2449dc1383bbac3b3713de27d37e79b 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -120,7 +120,7 @@ acl_fetch_ssl_hello_type(struct proxy *px, struct session *l4, void *l7, unsigne
 {
        int hs_len;
        int hs_type, bleft;
-       struct buffer *b;
+       struct channel *b;
        const unsigned char *data;
 
        if (!l4)
@@ -324,7 +324,7 @@ acl_fetch_ssl_hello_sni(struct proxy *px, struct session *l4, void *l7, unsigned
                         const struct arg *args, struct sample *smp)
 {
        int hs_len, ext_len, bleft;
-       struct buffer *b;
+       struct channel *b;
        unsigned char *data;
 
        if (!l4)
index e3a64e91499c842fb2236e2f92e6922488cb3dc7..b3bd972e7bee46001fa8b80347dbe5b81a946c63 100644 (file)
@@ -252,7 +252,7 @@ struct server *get_server_ph_post(struct session *s)
 {
        unsigned long    hash = 0;
        struct http_txn *txn  = &s->txn;
-       struct buffer   *req  = s->req;
+       struct channel   *req = s->req;
        struct http_msg *msg  = &txn->req;
        struct proxy    *px   = s->be;
        unsigned int     plen = px->url_param_len;
@@ -1122,7 +1122,7 @@ int srv_redispatch_connect(struct session *t)
  * session. This always returns 1, and the analyser removes itself from the
  * list. Nothing is performed if a server was already assigned.
  */
-int tcp_persist_rdp_cookie(struct session *s, struct buffer *req, int an_bit)
+int tcp_persist_rdp_cookie(struct session *s, struct channel *req, int an_bit)
 {
        struct proxy    *px   = s->be;
        int              ret;
index 6eeb64f548615b0f0e6b02e44376ba34eaeb74b2..6d87ef9fe859c51677a943b22cac3483534f5cd6 100644 (file)
@@ -26,7 +26,7 @@ struct pool_head *pool2_buffer;
 /* perform minimal intializations, report 0 in case of error, 1 if OK. */
 int init_buffer()
 {
-       pool2_buffer = create_pool("buffer", sizeof(struct buffer) + global.tune.bufsize, MEM_F_SHARED);
+       pool2_buffer = create_pool("buffer", sizeof(struct channel) + global.tune.bufsize, MEM_F_SHARED);
        return pool2_buffer != NULL;
 }
 
@@ -38,7 +38,7 @@ int init_buffer()
  * Directly touching ->to_forward will cause lockups when ->o goes down to
  * zero if nobody is ready to push the remaining data.
  */
-unsigned long long buffer_forward(struct buffer *buf, unsigned long long bytes)
+unsigned long long buffer_forward(struct channel *buf, unsigned long long bytes)
 {
        unsigned int new_forward;
        unsigned int forwarded;
@@ -96,7 +96,7 @@ unsigned long long buffer_forward(struct buffer *buf, unsigned long long bytes)
  * Note: this function appends data to the buffer's output and possibly overwrites
  * any pending input data which are assumed not to exist.
  */
-int bo_inject(struct buffer *buf, const char *msg, int len)
+int bo_inject(struct channel *buf, const char *msg, int len)
 {
        int max;
 
@@ -136,7 +136,7 @@ int bo_inject(struct buffer *buf, const char *msg, int len)
  * flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
  * transferred.
  */
-int bi_putchr(struct buffer *buf, char c)
+int bi_putchr(struct channel *buf, char c)
 {
        if (unlikely(buffer_input_closed(buf)))
                return -2;
@@ -169,7 +169,7 @@ int bi_putchr(struct buffer *buf, char c)
  * Buffer flags FULL, EMPTY and READ_PARTIAL are updated if some data can be
  * transferred.
  */
-int bi_putblk(struct buffer *buf, const char *blk, int len)
+int bi_putblk(struct channel *buf, const char *blk, int len)
 {
        int max;
 
@@ -228,7 +228,7 @@ int bi_putblk(struct buffer *buf, const char *blk, int len)
  * output are full. If either of them is full, the string may be returned
  * as is, without the '\n'.
  */
-int bo_getline(struct buffer *buf, char *str, int len)
+int bo_getline(struct channel *buf, char *str, int len)
 {
        int ret, max;
        char *p;
@@ -276,7 +276,7 @@ int bo_getline(struct buffer *buf, char *str, int len)
  * The buffer status is not changed. The caller must call bo_skip() to
  * update it.
  */
-int bo_getblk(struct buffer *buf, char *blk, int len, int offset)
+int bo_getblk(struct channel *buf, char *blk, int len, int offset)
 {
        int firstblock;
 
@@ -315,7 +315,7 @@ int bo_getblk(struct buffer *buf, char *blk, int len, int offset)
  * <orig> is not updated. The string length is taken from parameter <len>. If
  * <len> is null, the <str> pointer is allowed to be null.
  */
-int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int len)
+int buffer_replace2(struct channel *b, char *pos, char *end, const char *str, int len)
 {
        int delta;
 
@@ -357,7 +357,7 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int
  *
  * The number of bytes added is returned on success. 0 is returned on failure.
  */
-int buffer_insert_line2(struct buffer *b, char *pos, const char *str, int len)
+int buffer_insert_line2(struct channel *b, char *pos, const char *str, int len)
 {
        int delta;
 
@@ -390,7 +390,7 @@ int buffer_insert_line2(struct buffer *b, char *pos, const char *str, int len)
  * becomes contiguous and starts at the beginning of the buffer area. The
  * function may only be used when the buffer's output is empty.
  */
-void buffer_slow_realign(struct buffer *buf)
+void buffer_slow_realign(struct channel *buf)
 {
        /* two possible cases :
         *   - the buffer is in one contiguous block, we move it in-place
@@ -420,7 +420,7 @@ void buffer_slow_realign(struct buffer *buf)
  * so it's desirable to use it only on non-contiguous buffers. No pointers are
  * changed, the caller is responsible for that.
  */
-void buffer_bounce_realign(struct buffer *buf)
+void buffer_bounce_realign(struct channel *buf)
 {
        int advance, to_move;
        char *from, *to;
@@ -584,7 +584,7 @@ int chunk_asciiencode(struct chunk *dst, struct chunk *src, char qc) {
 /*
  * Dumps part or all of a buffer.
  */
-void buffer_dump(FILE *o, struct buffer *b, int from, int to)
+void buffer_dump(FILE *o, struct channel *b, int from, int to)
 {
        fprintf(o, "Dumping buffer %p\n", b);
        fprintf(o, "  data=%p o=%d i=%d p=%p\n",
index a125242c1852ae8bb6d1e2aa1fb240a1b0ed2e59..a3d0f2809a3c438df24401322216cba781d6b822 100644 (file)
@@ -1456,8 +1456,8 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
  */
 static void cli_io_handler(struct stream_interface *si)
 {
-       struct buffer *req = si->ob;
-       struct buffer *res = si->ib;
+       struct channel *req = si->ob;
+       struct channel *res = si->ib;
        int reql;
        int len;
 
@@ -1816,8 +1816,8 @@ static int stats_http_redir(struct stream_interface *si, struct uri_auth *uri)
 static void http_stats_io_handler(struct stream_interface *si)
 {
        struct session *s = si->conn.data_ctx;
-       struct buffer *req = si->ob;
-       struct buffer *res = si->ib;
+       struct channel *req = si->ob;
+       struct channel *res = si->ib;
 
        if (unlikely(si->state == SI_ST_DIS || si->state == SI_ST_CLO))
                goto out;
@@ -1872,7 +1872,7 @@ static void http_stats_io_handler(struct stream_interface *si)
 static int stats_dump_http(struct stream_interface *si, struct uri_auth *uri)
 {
        struct session *s = si->conn.data_ctx;
-       struct buffer *rep = si->ib;
+       struct channel *rep = si->ib;
        struct proxy *px;
        struct chunk msg;
        unsigned int up;
@@ -2242,7 +2242,7 @@ static int stats_dump_http(struct stream_interface *si, struct uri_auth *uri)
 static int stats_dump_proxy(struct stream_interface *si, struct proxy *px, struct uri_auth *uri)
 {
        struct session *s = si->conn.data_ctx;
-       struct buffer *rep = si->ib;
+       struct channel *rep = si->ib;
        struct server *sv, *svs;        /* server and server-state, server-state=server or server->track */
        struct listener *l;
        struct chunk msg;
index 82699dc4c0b962c2a94481ef33afbe3e916373aa..8405bf63f903e36ff1c2b7707ec278f203b68c0b 100644 (file)
@@ -251,7 +251,7 @@ int frontend_accept(struct session *s)
  * are removed from the buffer. The function returns zero if it needs to wait
  * for more data (max: timeout_client), or 1 if it has finished and removed itself.
  */
-int frontend_decode_proxy_request(struct session *s, struct buffer *req, int an_bit)
+int frontend_decode_proxy_request(struct session *s, struct channel *req, int an_bit)
 {
        char *line = req->data;
        char *end = req->data + req->i;
index 08e2c9d80a461e235c71fdfb7a776b169e13c04c..173ba32a61a39ae1e61aaa4cd474b5458d7709d0 100644 (file)
@@ -1290,7 +1290,7 @@ void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx)
 {
        unsigned int state;       /* updated only when leaving the FSM */
        register char *ptr, *end; /* request pointers, to avoid dereferences */
-       struct buffer *buf = msg->buf;
+       struct channel *buf = msg->buf;
 
        state = msg->msg_state;
        ptr = buf->p + msg->next;
@@ -1747,7 +1747,7 @@ void http_change_connection_header(struct http_txn *txn, struct http_msg *msg, i
  */
 int http_parse_chunk_size(struct http_msg *msg)
 {
-       const struct buffer *buf = msg->buf;
+       const struct channel *buf = msg->buf;
        const char *ptr = b_ptr(buf, msg->next);
        const char *ptr_old = ptr;
        const char *end = buf->data + buf->size;
@@ -1855,7 +1855,7 @@ int http_parse_chunk_size(struct http_msg *msg)
  */
 int http_forward_trailers(struct http_msg *msg)
 {
-       const struct buffer *buf = msg->buf;
+       const struct channel *buf = msg->buf;
 
        /* we have msg->next which points to next line. Look for CRLF. */
        while (1) {
@@ -1929,7 +1929,7 @@ int http_forward_trailers(struct http_msg *msg)
  */
 int http_skip_chunk_crlf(struct http_msg *msg)
 {
-       const struct buffer *buf = msg->buf;
+       const struct channel *buf = msg->buf;
        const char *ptr;
        int bytes;
 
@@ -1971,7 +1971,7 @@ int http_skip_chunk_crlf(struct http_msg *msg)
  * 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 an_bit)
+int http_wait_for_request(struct session *s, struct channel *req, int an_bit)
 {
        /*
         * We will parse the partial (or complete) lines.
@@ -2519,7 +2519,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
  * Parse the posted data and enable/disable servers if necessary.
  * Returns 1 if request was parsed or zero if it needs more data.
  */
-int http_process_req_stat_post(struct stream_interface *si, struct http_txn *txn, struct buffer *req)
+int http_process_req_stat_post(struct stream_interface *si, struct http_txn *txn, struct channel *req)
 {
        struct proxy *px = NULL;
        struct server *sv = NULL;
@@ -2772,7 +2772,7 @@ http_check_access_rule(struct proxy *px, struct list *rules, struct session *s,
  * either needs more data or wants to immediately abort the request (eg: deny,
  * error, ...).
  */
-int http_process_req_common(struct session *s, struct buffer *req, int an_bit, struct proxy *px)
+int http_process_req_common(struct session *s, struct channel *req, int an_bit, struct proxy *px)
 {
        struct http_txn *txn = &s->txn;
        struct http_msg *msg = &txn->req;
@@ -3237,7 +3237,7 @@ int http_process_req_common(struct session *s, struct buffer *req, int an_bit, s
  * 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 an_bit)
+int http_process_request(struct session *s, struct channel *req, int an_bit)
 {
        struct http_txn *txn = &s->txn;
        struct http_msg *msg = &txn->req;
@@ -3517,7 +3517,7 @@ int http_process_request(struct session *s, struct buffer *req, int an_bit)
  * 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 an_bit)
+int http_process_tarpit(struct session *s, struct channel *req, int an_bit)
 {
        struct http_txn *txn = &s->txn;
 
@@ -3563,7 +3563,7 @@ int http_process_tarpit(struct session *s, struct buffer *req, int an_bit)
  * 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 an_bit)
+int http_process_request_body(struct session *s, struct channel *req, int an_bit)
 {
        struct http_txn *txn = &s->txn;
        struct http_msg *msg = &s->txn.req;
@@ -3702,7 +3702,7 @@ int http_send_name_header(struct http_txn *txn, struct proxy* be, const char* sr
 
        char *hdr_name = be->server_id_hdr_name;
        int hdr_name_len = be->server_id_hdr_len;
-       struct buffer *req = txn->req.buf;
+       struct channel *req = txn->req.buf;
        char *hdr_val;
        unsigned int old_o, old_i;
 
@@ -3881,7 +3881,7 @@ void http_end_txn_clean_session(struct session *s)
  */
 int http_sync_req_state(struct session *s)
 {
-       struct buffer *buf = s->req;
+       struct channel *buf = s->req;
        struct http_txn *txn = &s->txn;
        unsigned int old_flags = buf->flags;
        unsigned int old_state = txn->req.msg_state;
@@ -4002,7 +4002,7 @@ int http_sync_req_state(struct session *s)
  */
 int http_sync_res_state(struct session *s)
 {
-       struct buffer *buf = s->rep;
+       struct channel *buf = s->rep;
        struct http_txn *txn = &s->txn;
        unsigned int old_flags = buf->flags;
        unsigned int old_state = txn->rsp.msg_state;
@@ -4202,7 +4202,7 @@ int http_resync_states(struct session *s)
  * bytes of pending data + the headers if not already done (between sol and sov).
  * It eventually adjusts sol to match sov after the data in between have been sent.
  */
-int http_request_forward_body(struct session *s, struct buffer *req, int an_bit)
+int http_request_forward_body(struct session *s, struct channel *req, int an_bit)
 {
        struct http_txn *txn = &s->txn;
        struct http_msg *msg = &s->txn.req;
@@ -4468,7 +4468,7 @@ int http_request_forward_body(struct session *s, struct buffer *req, int an_bit)
  * when it has nothing left to do, and may remove any analyser when it wants to
  * abort.
  */
-int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit)
+int http_wait_for_response(struct session *s, struct channel *rep, int an_bit)
 {
        struct http_txn *txn = &s->txn;
        struct http_msg *msg = &txn->rsp;
@@ -4897,7 +4897,7 @@ skip_content_length:
  * and updates t->rep->analysers. It might make sense to explode it into several
  * other functions. It works like process_request (see indications above).
  */
-int http_process_res_common(struct session *t, struct buffer *rep, int an_bit, struct proxy *px)
+int http_process_res_common(struct session *t, struct channel *rep, int an_bit, struct proxy *px)
 {
        struct http_txn *txn = &t->txn;
        struct http_msg *msg = &txn->rsp;
@@ -5269,7 +5269,7 @@ int http_process_res_common(struct session *t, struct buffer *rep, int an_bit, s
  * bytes of pending data + the headers if not already done (between sol and sov).
  * It eventually adjusts sol to match sov after the data in between have been sent.
  */
-int http_response_forward_body(struct session *s, struct buffer *res, int an_bit)
+int http_response_forward_body(struct session *s, struct channel *res, int an_bit)
 {
        struct http_txn *txn = &s->txn;
        struct http_msg *msg = &s->txn.rsp;
@@ -5498,7 +5498,7 @@ int http_response_forward_body(struct session *s, struct buffer *res, int an_bit
  * Since it can manage the switch to another backend, it updates the per-proxy
  * DENY stats.
  */
-int apply_filter_to_req_headers(struct session *t, struct buffer *req, struct hdr_exp *exp)
+int apply_filter_to_req_headers(struct session *t, struct channel *req, struct hdr_exp *exp)
 {
        char term;
        char *cur_ptr, *cur_end, *cur_next;
@@ -5632,7 +5632,7 @@ int apply_filter_to_req_headers(struct session *t, struct buffer *req, struct hd
  * Since it can manage the switch to another backend, it updates the per-proxy
  * DENY stats.
  */
-int apply_filter_to_req_line(struct session *t, struct buffer *req, struct hdr_exp *exp)
+int apply_filter_to_req_line(struct session *t, struct channel *req, struct hdr_exp *exp)
 {
        char term;
        char *cur_ptr, *cur_end;
@@ -5749,7 +5749,7 @@ int apply_filter_to_req_line(struct session *t, struct buffer *req, struct hdr_e
  * unparsable request. Since it can manage the switch to another backend, it
  * updates the per-proxy DENY stats.
  */
-int apply_filters_to_request(struct session *s, struct buffer *req, struct proxy *px)
+int apply_filters_to_request(struct session *s, struct channel *req, struct proxy *px)
 {
        struct http_txn *txn = &s->txn;
        struct hdr_exp *exp;
@@ -5914,7 +5914,7 @@ char *find_cookie_value_end(char *s, const char *e)
  *   - there are non-space chars before <from> ;
  *   - there is a CR/LF at or after <next>.
  */
-int del_hdr_value(struct buffer *buf, char **from, char *next)
+int del_hdr_value(struct channel *buf, char **from, char *next)
 {
        char *prev = *from;
 
@@ -5956,7 +5956,7 @@ int del_hdr_value(struct buffer *buf, char **from, char *next)
  * of the multiple very crappy and ambiguous syntaxes we have to support. it
  * highly recommended not to touch this part without a good reason !
  */
-void manage_client_side_cookies(struct session *t, struct buffer *req)
+void manage_client_side_cookies(struct session *t, struct channel *req)
 {
        struct http_txn *txn = &t->txn;
        int preserve_hdr;
@@ -6405,7 +6405,7 @@ void manage_client_side_cookies(struct session *t, struct buffer *req)
 /* Iterate the same filter through all response headers contained in <rtr>.
  * Returns 1 if this filter can be stopped upon return, otherwise 0.
  */
-int apply_filter_to_resp_headers(struct session *t, struct buffer *rtr, struct hdr_exp *exp)
+int apply_filter_to_resp_headers(struct session *t, struct channel *rtr, struct hdr_exp *exp)
 {
        char term;
        char *cur_ptr, *cur_end, *cur_next;
@@ -6504,7 +6504,7 @@ int apply_filter_to_resp_headers(struct session *t, struct buffer *rtr, struct h
  * Returns 0 if nothing has been done, 1 if the filter has been applied,
  * or -1 if a replacement resulted in an invalid status line.
  */
-int apply_filter_to_sts_line(struct session *t, struct buffer *rtr, struct hdr_exp *exp)
+int apply_filter_to_sts_line(struct session *t, struct channel *rtr, struct hdr_exp *exp)
 {
        char term;
        char *cur_ptr, *cur_end;
@@ -6587,7 +6587,7 @@ int apply_filter_to_sts_line(struct session *t, struct buffer *rtr, struct hdr_e
  * Returns 0 if everything is alright, or -1 in case a replacement lead to an
  * unparsable response.
  */
-int apply_filters_to_response(struct session *s, struct buffer *rtr, struct proxy *px)
+int apply_filters_to_response(struct session *s, struct channel *rtr, struct proxy *px)
 {
        struct http_txn *txn = &s->txn;
        struct hdr_exp *exp;
@@ -6644,7 +6644,7 @@ int apply_filters_to_response(struct session *s, struct buffer *rtr, struct prox
  * desirable to call it only when needed. This function is also used when we
  * just need to know if there is a cookie (eg: for check-cache).
  */
-void manage_server_side_cookies(struct session *t, struct buffer *res)
+void manage_server_side_cookies(struct session *t, struct channel *res)
 {
        struct http_txn *txn = &t->txn;
        struct server *srv;
@@ -7007,7 +7007,7 @@ void manage_server_side_cookies(struct session *t, struct buffer *res)
 /*
  * Check if response is cacheable or not. Updates t->flags.
  */
-void check_response_for_cacheability(struct session *t, struct buffer *rtr)
+void check_response_for_cacheability(struct session *t, struct channel *rtr)
 {
        struct http_txn *txn = &t->txn;
        char *p1, *p2;
@@ -7258,7 +7258,7 @@ void http_capture_bad_message(struct error_snapshot *es, struct session *s,
                               struct http_msg *msg,
                              int state, struct proxy *other_end)
 {
-       struct buffer *buf = msg->buf;
+       struct channel *buf = msg->buf;
        int len1, len2;
 
        es->len = MIN(buf->i, sizeof(es->buf));
index 6c411afe6300005f8ef759df2ef4a12c7e9200d8..57339c62887ca3a6fd5e6bc3b2d581b877410b71 100644 (file)
@@ -785,7 +785,7 @@ void tcpv6_add_listener(struct listener *listener)
  * function may be called for frontend rules and backend rules. It only relies
  * on the backend pointer so this works for both cases.
  */
-int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit)
+int tcp_inspect_request(struct session *s, struct channel *req, int an_bit)
 {
        struct tcp_rule *rule;
        struct stksess *ts;
@@ -905,7 +905,7 @@ int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit)
  * response. It relies on buffers flags, and updates s->rep->analysers. The
  * function may be called for backend rules.
  */
-int tcp_inspect_response(struct session *s, struct buffer *rep, int an_bit)
+int tcp_inspect_response(struct session *s, struct channel *rep, int an_bit)
 {
        struct tcp_rule *rule;
        int partial;
@@ -1583,7 +1583,7 @@ smp_fetch_payload_lv(struct proxy *px, struct session *l4, void *l7, unsigned in
        unsigned int len_size = arg_p[1].data.uint;
        unsigned int buf_offset;
        unsigned int buf_size = 0;
-       struct buffer *b;
+       struct channel *b;
        int i;
 
        /* Format is (len offset, len size, buf offset) or (len offset, len size) */
@@ -1638,7 +1638,7 @@ smp_fetch_payload(struct proxy *px, struct session *l4, void *l7, unsigned int o
 {
        unsigned int buf_offset = arg_p[0].data.uint;
        unsigned int buf_size = arg_p[1].data.uint;
-       struct buffer *b;
+       struct channel *b;
 
        if (!l4)
                return 0;
index 6612f0a43a1a019df806d8b46f03362d8c1e273e..3984104724d7c24c034340224faf93f9073fcdb4 100644 (file)
@@ -533,8 +533,8 @@ void session_process_counters(struct session *s)
  */
 static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si)
 {
-       struct buffer *req = si->ob;
-       struct buffer *rep = si->ib;
+       struct channel *req = si->ob;
+       struct channel *rep = si->ib;
 
        /* If we got an error, or if nothing happened and the connection timed
         * out, we must give up. The CER state handler will take care of retry
@@ -683,8 +683,8 @@ static int sess_update_st_cer(struct session *s, struct stream_interface *si)
  */
 static void sess_establish(struct session *s, struct stream_interface *si)
 {
-       struct buffer *req = si->ob;
-       struct buffer *rep = si->ib;
+       struct channel *req = si->ob;
+       struct channel *rep = si->ib;
 
        if (target_srv(&s->target))
                health_adjust(target_srv(&s->target), HANA_STATUS_L4_OK);
@@ -954,7 +954,7 @@ static void sess_prepare_conn_req(struct session *s, struct stream_interface *si
  * It returns 1 if the processing can continue on next analysers, or zero if it
  * either needs more data or wants to immediately abort the request.
  */
-static int process_switching_rules(struct session *s, struct buffer *req, int an_bit)
+static int process_switching_rules(struct session *s, struct channel *req, int an_bit)
 {
        struct persist_rule *prst_rule;
 
@@ -1051,7 +1051,7 @@ static int process_switching_rules(struct session *s, struct buffer *req, int an
  * it then returns 1. The data must already be present in the buffer otherwise
  * they won't match. It always returns 1.
  */
-static int process_server_rules(struct session *s, struct buffer *req, int an_bit)
+static int process_server_rules(struct session *s, struct channel *req, int an_bit)
 {
        struct proxy *px = s->be;
        struct server_rule *rule;
@@ -1100,7 +1100,7 @@ static int process_server_rules(struct session *s, struct buffer *req, int an_bi
  * it then returns 1. The data must already be present in the buffer otherwise
  * they won't match. It always returns 1.
  */
-static int process_sticking_rules(struct session *s, struct buffer *req, int an_bit)
+static int process_sticking_rules(struct session *s, struct channel *req, int an_bit)
 {
        struct proxy    *px   = s->be;
        struct sticking_rule  *rule;
@@ -1189,7 +1189,7 @@ static int process_sticking_rules(struct session *s, struct buffer *req, int an_
  * then returns 1. The data must already be present in the buffer otherwise
  * they won't match. It always returns 1.
  */
-static int process_store_rules(struct session *s, struct buffer *rep, int an_bit)
+static int process_store_rules(struct session *s, struct channel *rep, int an_bit)
 {
        struct proxy    *px   = s->be;
        struct sticking_rule  *rule;
index 991b46b9f385535feba5b6b31163beeb704089e6..272935a359516a692be7e0ab287788d406d4a551 100644 (file)
@@ -74,7 +74,7 @@ static void sock_raw_read(struct connection *conn);
  * This function automatically allocates a pipe from the pipe pool. It also
  * carefully ensures to clear b->pipe whenever it leaves the pipe empty.
  */
-static int sock_raw_splice_in(struct buffer *b, struct stream_interface *si)
+static int sock_raw_splice_in(struct channel *b, struct stream_interface *si)
 {
        static int splice_detects_close;
        int fd = si_fd(si);
@@ -216,7 +216,7 @@ static void sock_raw_read(struct connection *conn)
 {
        int fd = conn->t.sock.fd;
        struct stream_interface *si = container_of(conn, struct stream_interface, conn);
-       struct buffer *b = si->ib;
+       struct channel *b = si->ib;
        int ret, max, cur_read;
        int read_poll = MAX_READ_POLL_LOOPS;
 
@@ -452,7 +452,7 @@ static void sock_raw_read(struct connection *conn)
 static int sock_raw_write_loop(struct connection *conn)
 {
        struct stream_interface *si = container_of(conn, struct stream_interface, conn);
-       struct buffer *b = si->ob;
+       struct channel *b = si->ob;
        int write_poll = MAX_WRITE_POLL_LOOPS;
        int ret, max;
 
index 17f2447db1d7155594b982a3d5c50c17db1372e6..08560a9c521e660ab53ac67c97eab2e22b1dba15 100644 (file)
@@ -354,7 +354,7 @@ int stream_int_shutw(struct stream_interface *si)
 /* default chk_rcv function for scheduled tasks */
 static void stream_int_chk_rcv(struct stream_interface *si)
 {
-       struct buffer *ib = si->ib;
+       struct channel *ib = si->ib;
 
        DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n",
                __FUNCTION__,
@@ -379,7 +379,7 @@ static void stream_int_chk_rcv(struct stream_interface *si)
 /* default chk_snd function for scheduled tasks */
 static void stream_int_chk_snd(struct stream_interface *si)
 {
-       struct buffer *ob = si->ob;
+       struct channel *ob = si->ob;
 
        DPRINTF(stderr, "%s: si=%p, si->state=%d ib->flags=%08x ob->flags=%08x\n",
                __FUNCTION__,
@@ -482,7 +482,7 @@ int conn_si_send_proxy(struct connection *conn, unsigned int flag)
 {
        int fd = conn->t.sock.fd;
        struct stream_interface *si = container_of(conn, struct stream_interface, conn);
-       struct buffer *b = si->ob;
+       struct channel *b = si->ob;
 
        /* we might have been called just after an asynchronous shutw */
        if (b->flags & BF_SHUTW)
@@ -664,8 +664,8 @@ void conn_notify_si(struct connection *conn)
  */
 void stream_int_update_conn(struct stream_interface *si)
 {
-       struct buffer *ib = si->ib;
-       struct buffer *ob = si->ob;
+       struct channel *ib = si->ib;
+       struct channel *ob = si->ob;
 
        if (si->conn.flags & CO_FL_HANDSHAKE) {
                /* a handshake is in progress */
@@ -742,7 +742,7 @@ void stream_int_update_conn(struct stream_interface *si)
  */
 void stream_int_chk_rcv_conn(struct stream_interface *si)
 {
-       struct buffer *ib = si->ib;
+       struct channel *ib = si->ib;
 
        if (unlikely(si->state != SI_ST_EST || (ib->flags & BF_SHUTR)))
                return;
@@ -773,7 +773,7 @@ void stream_int_chk_rcv_conn(struct stream_interface *si)
  */
 void stream_int_chk_snd_conn(struct stream_interface *si)
 {
-       struct buffer *ob = si->ob;
+       struct channel *ob = si->ob;
 
        if (unlikely(si->state != SI_ST_EST || (ob->flags & BF_SHUTW)))
                return;
@@ -872,7 +872,7 @@ void stream_int_chk_snd_conn(struct stream_interface *si)
 void si_conn_send_cb(struct connection *conn)
 {
        struct stream_interface *si = container_of(conn, struct stream_interface, conn);
-       struct buffer *b = si->ob;
+       struct channel *b = si->ob;
 
        if (conn->flags & CO_FL_ERROR)
                goto out_error;