Skip to content

Commit

Permalink
[fix] fixed a bug may lead to infinite loop and some typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
winshining committed Jan 12, 2021
1 parent 4b75983 commit ae6ef22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 1 addition & 12 deletions ngx_http_flv_live_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,6 @@ ngx_http_flv_live_close_stream(ngx_rtmp_session_t *s,
ngx_rtmp_live_ctx_t *ctx, **cctx, *unlink;
ngx_http_request_t *r;
ngx_rtmp_live_app_conf_t *lacf;
ngx_rtmp_live_stream_t **stream;
ngx_flag_t passive;

lacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_live_module);
Expand Down Expand Up @@ -1270,16 +1269,6 @@ ngx_http_flv_live_close_stream(ngx_rtmp_session_t *s,

*cctx = ctx->next;

if (ctx->stream->pub_ctx == NULL) {
stream = ngx_rtmp_live_get_stream(s, ctx->stream->name, 0);
if (stream) {
*stream = (*stream)->next;

ctx->stream->next = lacf->free_streams;
lacf->free_streams = ctx->stream;
}
}

ctx->next = NULL;
ctx->stream = NULL;

Expand All @@ -1295,7 +1284,7 @@ ngx_http_flv_live_close_stream(ngx_rtmp_session_t *s,

/**
* close only http requests here, the other
* requests were left for next_clost_stream
* requests were left for next_close_stream
**/

next:
Expand Down
2 changes: 1 addition & 1 deletion ngx_rtmp_live_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ ngx_rtmp_live_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)

cln = ngx_pool_cleanup_add(cf->pool, 0);
if (cln == NULL) {
return NULL;
return NGX_CONF_ERROR;
}

cln->handler = ngx_rtmp_live_free_pool_cleanup;
Expand Down

0 comments on commit ae6ef22

Please sign in to comment.