mirror of https://github.com/ossrs/srs.git
Live: Crash for invalid live stream state when unmount HTTP. v6.0.146 v7.0.3 (#4141)
When unpublishing, the handler callback that will stop the coroutine: ```cpp _can_publish = true; handler->on_unpublish(req); ``` In this handler, the `http_unmount` will be called: ```cpp void SrsHttpStreamServer::http_unmount(SrsRequest* r) cache->stop(); ``` In this `http_unmount` function, there could be context switching. In such a situation, a new connection might publish the stream while the unpublish process is freeing the stream, leading to a crash. To prevent a new publisher, we should change the state only after all handlers and hooks are completed. --------- Co-authored-by: liumengte <liumengte@visionular.com> Co-authored-by: winlin <winlinvip@gmail.com>pull/4142/head
parent
16e569d823
commit
38417d9ccc
Loading…
Reference in New Issue