1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00
srs/trunk/src
Bahamut 957140db51 Live: Crash for invalid live stream state when unmount HTTP. v6.0.146 (#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:43:59 +08:00
..
app Live: Crash for invalid live stream state when unmount HTTP. v6.0.146 (#4141) 2024-08-15 10:43:59 +08:00
core Config: Improve env config to support multi values. v6.0.146 (#4092) 2024-08-13 11:26:23 +08:00
kernel HTTP-TS: Support guess_has_av for audio only stream. v6.0.141 (#4063) 2024-07-24 11:00:18 +08:00
main UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 (#4109) 2024-07-09 10:29:36 +08:00
protocol UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 (#4109) 2024-07-09 10:29:36 +08:00
utest Config: Improve env config to support multi values. v6.0.146 (#4092) 2024-08-13 11:26:23 +08:00