From: Willy Tarreau Date: Fri, 12 Oct 2012 21:53:39 +0000 (+0200) Subject: CLEANUP: tcp: use 'chn' instead of 'buf' or 'b' for channel pointer names X-Git-Tag: v1.5-dev13~149 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=697d85045adb62980e28ede6abc5d4f71d3e2873;p=thirdparty%2Fhaproxy.git CLEANUP: tcp: use 'chn' instead of 'buf' or 'b' for channel pointer names Same as previous patches, avoid confusion in local variable names. --- diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 8b0792baa3..7185a0a400 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -1580,7 +1580,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 channel *b; + struct channel *chn; int i; /* Format is (len offset, len size, buf offset) or (len offset, len size) */ @@ -1590,16 +1590,16 @@ smp_fetch_payload_lv(struct proxy *px, struct session *l4, void *l7, unsigned in if (!l4) return 0; - b = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? l4->rep : l4->req; + chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? l4->rep : l4->req; - if (!b) + if (!chn) return 0; - if (len_offset + len_size > b->buf.i) + if (len_offset + len_size > chn->buf.i) goto too_short; for (i = 0; i < len_size; i++) { - buf_size = (buf_size << 8) + ((unsigned char *)b->buf.p)[i + len_offset]; + buf_size = (buf_size << 8) + ((unsigned char *)chn->buf.p)[i + len_offset]; } /* buf offset may be implicit, absolute or relative */ @@ -1609,18 +1609,18 @@ smp_fetch_payload_lv(struct proxy *px, struct session *l4, void *l7, unsigned in else if (arg_p[2].type == ARGT_SINT) buf_offset += arg_p[2].data.sint; - if (!buf_size || buf_size > b->buf.size || buf_offset + buf_size > b->buf.size) { + if (!buf_size || buf_size > chn->buf.size || buf_offset + buf_size > chn->buf.size) { /* will never match */ smp->flags = 0; return 0; } - if (buf_offset + buf_size > b->buf.i) + if (buf_offset + buf_size > chn->buf.i) goto too_short; /* init chunk as read only */ smp->type = SMP_T_CBIN; - chunk_initlen(&smp->data.str, b->buf.p + buf_offset, 0, buf_size); + chunk_initlen(&smp->data.str, chn->buf.p + buf_offset, 0, buf_size); smp->flags = SMP_F_VOLATILE; return 1; @@ -1635,28 +1635,28 @@ 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 channel *b; + struct channel *chn; if (!l4) return 0; - b = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? l4->rep : l4->req; + chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? l4->rep : l4->req; - if (!b) + if (!chn) return 0; - if (!buf_size || buf_size > b->buf.size || buf_offset + buf_size > b->buf.size) { + if (!buf_size || buf_size > chn->buf.size || buf_offset + buf_size > chn->buf.size) { /* will never match */ smp->flags = 0; return 0; } - if (buf_offset + buf_size > b->buf.i) + if (buf_offset + buf_size > chn->buf.i) goto too_short; /* init chunk as read only */ smp->type = SMP_T_CBIN; - chunk_initlen(&smp->data.str, b->buf.p + buf_offset, 0, buf_size); + chunk_initlen(&smp->data.str, chn->buf.p + buf_offset, 0, buf_size); smp->flags = SMP_F_VOLATILE; return 1;