diff --git a/ngx_rtmp_stat_module.c b/ngx_rtmp_stat_module.c index e48952d..f9d39c8 100644 --- a/ngx_rtmp_stat_module.c +++ b/ngx_rtmp_stat_module.c @@ -507,7 +507,6 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll, ngx_int_t n; ngx_uint_t nclients, total_nclients; ngx_uint_t f; - ngx_flag_t prev; u_char buf[NGX_INT_T_LEN]; u_char bbuf[NGX_INT32_LEN]; ngx_rtmp_stat_loc_conf_t *slcf; @@ -528,16 +527,11 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll, total_nclients = 0; for (n = 0; n < lacf->nbuckets; ++n) { - prev = 0; - if (n && lacf->streams[n - 1]) { - prev = 1; - } - for (stream = lacf->streams[n]; stream; stream = stream->next) { if (slcf->format & NGX_RTMP_STAT_FORMAT_XML) { NGX_RTMP_STAT_L("\r\n"); } else { - if (prev || stream->next) { + if (total_nclients || stream->next) { NGX_RTMP_STAT_L(","); } @@ -897,7 +891,6 @@ ngx_rtmp_stat_play(ngx_http_request_t *r, ngx_chain_t ***lll, ngx_rtmp_play_ctx_t *ctx, *sctx; ngx_rtmp_session_t *s; ngx_uint_t n, nclients, total_nclients; - ngx_flag_t prev; u_char buf[NGX_INT_T_LEN]; u_char bbuf[NGX_INT32_LEN]; ngx_rtmp_stat_loc_conf_t *slcf; @@ -917,11 +910,6 @@ ngx_rtmp_stat_play(ngx_http_request_t *r, ngx_chain_t ***lll, total_nclients = 0; for (n = 0; n < pacf->nbuckets; ++n) { - prev = 0; - if (n && pacf->ctx[n - 1]) { - prev = 1; - } - for (ctx = pacf->ctx[n]; ctx; ) { if (slcf->format & NGX_RTMP_STAT_FORMAT_XML) { NGX_RTMP_STAT_L("\r\n"); @@ -929,7 +917,7 @@ ngx_rtmp_stat_play(ngx_http_request_t *r, ngx_chain_t ***lll, NGX_RTMP_STAT_ECS(ctx->name); NGX_RTMP_STAT_L("\r\n"); } else { - if (prev || ctx->next) { + if (total_nclients || ctx->next) { NGX_RTMP_STAT_L(","); }