diff --git a/ngx_rtmp.h b/ngx_rtmp.h index a7f79f9..2855ee0 100644 --- a/ngx_rtmp.h +++ b/ngx_rtmp.h @@ -200,8 +200,8 @@ typedef struct { ngx_uint_t hs_stage; /* connection timestamps */ - uint32_t epoch; - uint32_t peer_epoch; + ngx_msec_t epoch; + ngx_msec_t peer_epoch; /* input stream 0 (reserved by RTMP spec) * is used as free chain link */ diff --git a/ngx_rtmp_handshake.c b/ngx_rtmp_handshake.c index ab493e7..910c28f 100644 --- a/ngx_rtmp_handshake.c +++ b/ngx_rtmp_handshake.c @@ -282,6 +282,7 @@ ngx_rtmp_handshake_parse_challenge(ngx_rtmp_session_t *s, return NGX_ERROR; } ++b->pos; + s->peer_epoch = 0; ngx_rtmp_rmemcpy(&s->peer_epoch, b->pos, 4); p = b->pos + 4; @@ -289,7 +290,7 @@ ngx_rtmp_handshake_parse_challenge(ngx_rtmp_session_t *s, "handshake: peer version=%i.%i.%i.%i epoch=%uD", (ngx_int_t)p[3], (ngx_int_t)p[2], (ngx_int_t)p[1], (ngx_int_t)p[0], - s->peer_epoch); + (uint32_t)s->peer_epoch); if (*(uint32_t *)p == 0) { s->hs_old = 1; return NGX_OK; diff --git a/ngx_rtmp_live_module.c b/ngx_rtmp_live_module.c index ec2c932..d17f911 100644 --- a/ngx_rtmp_live_module.c +++ b/ngx_rtmp_live_module.c @@ -161,6 +161,7 @@ ngx_rtmp_live_get_stream(ngx_rtmp_session_t *s, u_char *name, int create) ngx_memzero(*stream, sizeof(ngx_rtmp_live_stream_t)); ngx_memcpy((*stream)->name, name, ngx_min(sizeof((*stream)->name) - 1, len)); + (*stream)->epoch = ngx_current_msec; return stream; } diff --git a/ngx_rtmp_live_module.h b/ngx_rtmp_live_module.h index 1caf4da..ddfd4f3 100644 --- a/ngx_rtmp_live_module.h +++ b/ngx_rtmp_live_module.h @@ -53,6 +53,7 @@ struct ngx_rtmp_live_stream_s { ngx_rtmp_bandwidth_t bw_in; ngx_rtmp_bandwidth_t bw_out; ngx_rtmp_live_meta_t meta; + ngx_msec_t epoch; }; diff --git a/ngx_rtmp_relay_module.c b/ngx_rtmp_relay_module.c index e8a6787..b36110a 100644 --- a/ngx_rtmp_relay_module.c +++ b/ngx_rtmp_relay_module.c @@ -1030,6 +1030,15 @@ ngx_rtmp_relay_disconnect(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, ngx_rtmp_relay_push(ctx-publish->session, &ctx->publish->name, &target); }*/ +#ifdef NGX_DEBUG + { + ngx_uint_t n = 0; + for (cctx = &ctx->publish->play; *cctx; cctx = &(*cctx)->next, ++n); + ngx_log_debug3(NGX_LOG_DEBUG_RTMP, ctx->session->connection->log, 0, + "relay: play left after disconnect app='%V' name='%V': %ui", + &ctx->app, &ctx->name, n); + } +#endif if (ctx->publish->play == NULL) { ngx_log_debug2(NGX_LOG_DEBUG_RTMP, diff --git a/ngx_rtmp_stat_module.c b/ngx_rtmp_stat_module.c index 4db736f..39598f1 100644 --- a/ngx_rtmp_stat_module.c +++ b/ngx_rtmp_stat_module.c @@ -227,6 +227,11 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll, NGX_RTMP_STAT_ECS(stream->name); NGX_RTMP_STAT_L("\r\n"); + NGX_RTMP_STAT_L(""); + meta = &stream->meta; NGX_RTMP_STAT_L(""); NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf), @@ -264,6 +269,11 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll, NGX_RTMP_STAT_S(&s->connection->addr_text); NGX_RTMP_STAT_L(""); + NGX_RTMP_STAT_L(""); + NGX_RTMP_STAT_L(""); NGX_RTMP_STAT(buf, ngx_snprintf(buf, sizeof(buf), "%uz", ctx->dropped) - buf); diff --git a/stat.xsl b/stat.xsl index e9be297..1c2c930 100644 --- a/stat.xsl +++ b/stat.xsl @@ -2,6 +2,7 @@ + @@ -29,6 +30,7 @@ Video Audio State + Time @@ -91,6 +93,11 @@ + + + + + @@ -104,6 +111,7 @@ Flash version Page URL Dropped + Time @@ -111,17 +119,34 @@ + + + + + + + + + d + + + + h + + + + m + + + s + + + - - - - - - - - - + + + @@ -130,8 +155,11 @@ + - + + +