@@ -507,7 +507,6 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll,
507
507
ngx_int_t n ;
508
508
ngx_uint_t nclients , total_nclients ;
509
509
ngx_uint_t f ;
510
- ngx_flag_t prev ;
511
510
u_char buf [NGX_INT_T_LEN ];
512
511
u_char bbuf [NGX_INT32_LEN ];
513
512
ngx_rtmp_stat_loc_conf_t * slcf ;
@@ -528,16 +527,11 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll,
528
527
529
528
total_nclients = 0 ;
530
529
for (n = 0 ; n < lacf -> nbuckets ; ++ n ) {
531
- prev = 0 ;
532
- if (n && lacf -> streams [n - 1 ]) {
533
- prev = 1 ;
534
- }
535
-
536
530
for (stream = lacf -> streams [n ]; stream ; stream = stream -> next ) {
537
531
if (slcf -> format & NGX_RTMP_STAT_FORMAT_XML ) {
538
532
NGX_RTMP_STAT_L ("<stream>\r\n" );
539
533
} else {
540
- if (prev || stream -> next ) {
534
+ if (total_nclients || stream -> next ) {
541
535
NGX_RTMP_STAT_L ("," );
542
536
}
543
537
@@ -897,7 +891,6 @@ ngx_rtmp_stat_play(ngx_http_request_t *r, ngx_chain_t ***lll,
897
891
ngx_rtmp_play_ctx_t * ctx , * sctx ;
898
892
ngx_rtmp_session_t * s ;
899
893
ngx_uint_t n , nclients , total_nclients ;
900
- ngx_flag_t prev ;
901
894
u_char buf [NGX_INT_T_LEN ];
902
895
u_char bbuf [NGX_INT32_LEN ];
903
896
ngx_rtmp_stat_loc_conf_t * slcf ;
@@ -917,19 +910,14 @@ ngx_rtmp_stat_play(ngx_http_request_t *r, ngx_chain_t ***lll,
917
910
918
911
total_nclients = 0 ;
919
912
for (n = 0 ; n < pacf -> nbuckets ; ++ n ) {
920
- prev = 0 ;
921
- if (n && pacf -> ctx [n - 1 ]) {
922
- prev = 1 ;
923
- }
924
-
925
913
for (ctx = pacf -> ctx [n ]; ctx ; ) {
926
914
if (slcf -> format & NGX_RTMP_STAT_FORMAT_XML ) {
927
915
NGX_RTMP_STAT_L ("<stream>\r\n" );
928
916
NGX_RTMP_STAT_L ("<name>" );
929
917
NGX_RTMP_STAT_ECS (ctx -> name );
930
918
NGX_RTMP_STAT_L ("</name>\r\n" );
931
919
} else {
932
- if (prev || ctx -> next ) {
920
+ if (total_nclients || ctx -> next ) {
933
921
NGX_RTMP_STAT_L ("," );
934
922
}
935
923
0 commit comments