From 709b173bdc5fb61b0945b2d6eb798964c981ad97 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Thu, 18 Apr 2013 23:57:13 +0400 Subject: [PATCH] fixed done-family notifications when on_play/on_published failed --- ngx_rtmp_notify_module.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ngx_rtmp_notify_module.c b/ngx_rtmp_notify_module.c index b585cb8..d724e74 100644 --- a/ngx_rtmp_notify_module.c +++ b/ngx_rtmp_notify_module.c @@ -915,6 +915,17 @@ ngx_rtmp_notify_parse_http_header(ngx_rtmp_session_t *s, } +static void +ngx_rtmp_notify_clear_flag(ngx_rtmp_session_t *s, ngx_uint_t flag) +{ + ngx_rtmp_notify_ctx_t *ctx; + + ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module); + + ctx->flags &= ~flag; +} + + static ngx_int_t ngx_rtmp_notify_connect_handle(ngx_rtmp_session_t *s, void *arg, ngx_chain_t *in) @@ -959,6 +970,7 @@ ngx_rtmp_notify_publish_handle(ngx_rtmp_session_t *s, rc = ngx_rtmp_notify_parse_http_retcode(s, in); if (rc == NGX_ERROR) { + ngx_rtmp_notify_clear_flag(s, NGX_RTMP_NOTIFY_PUBLISHING); return NGX_ERROR; } @@ -991,6 +1003,7 @@ ngx_rtmp_notify_play_handle(ngx_rtmp_session_t *s, rc = ngx_rtmp_notify_parse_http_retcode(s, in); if (rc == NGX_ERROR) { + ngx_rtmp_notify_clear_flag(s, NGX_RTMP_NOTIFY_PLAYING); return NGX_ERROR; }