CLEANUP: remove trashlen
trashlen is a copy of global.tune.bufsize, so let's stop using it as
a duplicate, fall back to the original bufsize, it's less confusing
this way.
diff --git a/src/dumpstats.c b/src/dumpstats.c
index d0f0345..21517be 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -599,7 +599,7 @@
case STAT_CLI_O_TAB:
if (!ts)
return;
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
if (!stats_dump_table_head_to_buffer(&msg, si, px, px))
return;
stats_dump_table_entry_to_buffer(&msg, si, px, ts);
@@ -1026,7 +1026,7 @@
}
/* return server's effective weight at the moment */
- snprintf(trash, trashlen, "%d (initial %d)\n", sv->uweight, sv->iweight);
+ snprintf(trash, global.tune.bufsize, "%d (initial %d)\n", sv->uweight, sv->iweight);
bi_putstr(si->ib, trash);
return 1;
}
@@ -1495,7 +1495,7 @@
if (buffer_almost_full(si->ib->buf))
break;
- reql = bo_getline(si->ob, trash, trashlen);
+ reql = bo_getline(si->ob, trash, global.tune.bufsize);
if (reql <= 0) { /* closed or EOL not found */
if (reql == 0)
break;
@@ -1668,7 +1668,7 @@
struct chunk msg;
unsigned int up;
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
switch (si->conn.xprt_st) {
case STAT_ST_INIT:
@@ -1784,7 +1784,7 @@
struct session *s = si->conn.xprt_ctx;
struct chunk msg;
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
switch (si->conn.xprt_st) {
case STAT_ST_INIT:
@@ -1888,7 +1888,7 @@
struct chunk msg;
unsigned int up;
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
switch (si->conn.xprt_st) {
case STAT_ST_INIT:
@@ -2258,7 +2258,7 @@
struct listener *l;
struct chunk msg;
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
switch (si->applet.ctx.stats.px_st) {
case STAT_PX_ST_INIT:
@@ -3315,7 +3315,7 @@
extern const char *monthname[12];
char pn[INET6_ADDRSTRLEN];
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
sess = si->applet.ctx.sess.target;
if (si->applet.ctx.sess.section > 0 && si->applet.ctx.sess.uid != sess->uniq_id) {
@@ -3569,7 +3569,7 @@
return 1;
}
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
switch (si->conn.xprt_st) {
case STAT_ST_INIT:
@@ -3790,7 +3790,7 @@
return 1;
}
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
while (si->conn.xprt_st != STAT_ST_FIN) {
switch (si->conn.xprt_st) {
@@ -3985,7 +3985,7 @@
if (unlikely(si->ib->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
- chunk_init(&msg, trash, trashlen);
+ chunk_init(&msg, trash, global.tune.bufsize);
if (!si->applet.ctx.errors.px) {
/* the function had not been called yet, let's prepare the