1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00
srs/trunk/src/core
Bahamut 38417d9ccc
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>
2024-08-15 10:41:57 +08:00
..
srs_core.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core.hpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_autofree.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_autofree.hpp UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 (#4109) 2024-07-09 10:29:36 +08:00
srs_core_deprecated.cpp UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 (#4109) 2024-07-09 10:29:36 +08:00
srs_core_deprecated.hpp UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 (#4109) 2024-07-09 10:29:36 +08:00
srs_core_performance.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_performance.hpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_platform.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_platform.hpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_time.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_time.hpp Typo: Fix some typos for #3973 #3976 #3982. v6.0.114 (#3973) 2024-03-18 10:17:00 +08:00
srs_core_version.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_version.hpp Start the SRS 7.0.0 2024-07-27 11:43:09 +08:00
srs_core_version3.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_version3.hpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_version4.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_version4.hpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_version5.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_version5.hpp Edge: Improve stability for state and fd closing. v5.0.214 v6.0.139 (#4126) 2024-07-24 10:14:10 +08:00
srs_core_version6.cpp Switch to 2013-2024. v6.0.109 2024-01-01 10:51:24 +08:00
srs_core_version6.hpp Live: Crash for invalid live stream state when unmount HTTP. v6.0.146 v7.0.3 (#4141) 2024-08-15 10:41:57 +08:00
srs_core_version7.cpp Start the SRS 7.0.0 2024-07-27 11:43:09 +08:00
srs_core_version7.hpp Live: Crash for invalid live stream state when unmount HTTP. v6.0.146 v7.0.3 (#4141) 2024-08-15 10:41:57 +08:00