Skip to content

Commit

Permalink
Hack for circular chain by @heftig
Browse files Browse the repository at this point in the history
- fix infinite loop on session close
  • Loading branch information
sergey-dryabzhinsky committed Jul 26, 2016
1 parent 7db5ef0 commit e4799c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ngx_rtmp_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ ngx_rtmp_free_shared_chain(ngx_rtmp_core_srv_conf_t *cscf, ngx_chain_t *in)
}

for (cl = in; ; cl = cl->next) {
if (cl->next == NULL) {
/* FIXME: Don't create circular chains in the first place */
if (cl->next == NULL || cl->next == in) {
cl->next = cscf->free;
cscf->free = in;
return;
Expand Down

0 comments on commit e4799c6

Please sign in to comment.