static void stats_dump_json_schema(struct buffer *out);
-int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk)
+int stats_putchk(struct channel *chn, struct htx *htx)
{
+ struct buffer *chk = &trash_chunk;
+
if (htx) {
if (chk->data >= channel_htx_recv_max(chn, htx))
return 0;
case STAT_PX_ST_TH:
if (ctx->flags & STAT_FMT_HTML) {
stats_dump_html_px_hdr(sc, px);
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
}
case STAT_PX_ST_FE:
/* print the frontend */
if (stats_dump_fe_stats(sc, px)) {
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
if (ctx->field)
goto more;
/* print the frontend */
if (stats_dump_li_stats(sc, px, l)) {
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
if (ctx->field)
goto more;
}
if (stats_dump_sv_stats(sc, px, sv)) {
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
}
} /* for sv */
case STAT_PX_ST_BE:
/* print the backend */
if (stats_dump_be_stats(sc, px)) {
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
if (ctx->field)
goto more;
case STAT_PX_ST_END:
if (ctx->flags & STAT_FMT_HTML) {
stats_dump_html_px_end(sc, px);
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
}
else if (!(ctx->flags & STAT_FMT_TYPED))
stats_dump_csv_header(ctx->domain);
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
if (ctx->flags & STAT_JSON_SCHM) {
case STAT_STATE_INFO:
if (ctx->flags & STAT_FMT_HTML) {
stats_dump_html_info(sc, uri);
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
}
stats_dump_html_end();
else
stats_dump_json_end();
- if (!stats_putchk(rep, htx, &trash_chunk))
+ if (!stats_putchk(rep, htx))
goto full;
}