Permalink
Browse files

removed extra finalizer && added check for local relay end registerin…

…g as destination in relay stream
  • Loading branch information...
1 parent da1915b commit 70b27b197193ffce34f50c404e66c34139326987 @arut committed May 16, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 ngx_rtmp_relay_module.c
View
@@ -295,6 +295,12 @@ ngx_rtmp_relay_init(ngx_rtmp_session_t *s, u_char *name)
len = ngx_strlen(name);
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_relay_module);
+
+ /* is this local relay end? */
+ if (ctx && ctx->src == ctx) {
+ return NGX_OK;
+ }
+
if (ctx == NULL) {
ctx = ngx_pcalloc(s->connection->pool, sizeof(ngx_rtmp_relay_ctx_t));
if (ctx == NULL) {
@@ -706,7 +712,6 @@ ngx_rtmp_relay_disconnect(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
if (*cctx) {
*cctx = ctx->next;
}
- ngx_rtmp_finalize_session(ctx->session);
return NGX_OK;
}

0 comments on commit 70b27b1

Please sign in to comment.