s->data_ctx.stats.flags |= STAT_SHOW_STAT;
s->data_ctx.stats.flags |= STAT_FMT_CSV;
s->ana_state = STATS_ST_REP;
+ stream_int_retnclose(s->rep->cons, NULL);
buffer_install_hijacker(s, s->rep, stats_dump_raw_to_buffer);
}
else if (strcmp(args[1], "info") == 0) {
s->data_ctx.stats.flags |= STAT_SHOW_INFO;
s->data_ctx.stats.flags |= STAT_FMT_CSV;
s->ana_state = STATS_ST_REP;
+ stream_int_retnclose(s->rep->cons, NULL);
buffer_install_hijacker(s, s->rep, stats_dump_raw_to_buffer);
}
else if (strcmp(args[1], "sess") == 0) {
s->ana_state = STATS_ST_REP;
+ stream_int_retnclose(s->rep->cons, NULL);
buffer_install_hijacker(s, s->rep, stats_dump_sess_to_buffer);
}
else if (strcmp(args[1], "errors") == 0) {
s->data_ctx.errors.iid = -1;
s->data_ctx.errors.px = NULL;
s->ana_state = STATS_ST_REP;
+ stream_int_retnclose(s->rep->cons, NULL);
buffer_install_hijacker(s, s->rep, stats_dump_errors_to_buffer);
}
else { /* neither "stat" nor "info" nor "sess" */
/* the function had not been called yet, let's prepare the
* buffer for a response.
*/
- stream_int_retnclose(rep->cons, &msg);
s->data_state = DATA_ST_HEAD;
/* fall through */
chunk_printf(&msg, sizeof(trash), "\r\n");
s->txn.status = 200;
- stream_int_retnclose(rep->cons, &msg); // send the start of the response.
+ if (buffer_write_chunk(rep, &msg) >= 0)
+ return 0;
+
msg.len = 0;
if (!(s->flags & SN_ERR_MASK)) // this is not really an error but it is
* this pointer. We know we have reached the end when this
* pointer points back to the head of the sessions list.
*/
- stream_int_retnclose(rep->cons, &msg);
LIST_INIT(&s->data_ctx.sess.bref.users);
s->data_ctx.sess.bref.ref = sessions.n;
s->data_state = DATA_ST_LIST;
/* the function had not been called yet, let's prepare the
* buffer for a response.
*/
- stream_int_retnclose(rep->cons, &msg);
s->data_ctx.errors.px = proxy;
s->data_ctx.errors.buf = 0;
s->data_ctx.errors.bol = 0;