mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
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>
|
||
|---|---|---|
| .. | ||
| 3rdparty | ||
| auto | ||
| conf | ||
| doc | ||
| etc/init.d | ||
| gdb | ||
| ide/srs_clion | ||
| modules | ||
| packaging | ||
| research | ||
| scripts | ||
| src | ||
| usr/lib/systemd/system | ||
| .gitignore | ||
| AUTHORS.md | ||
| AUTHORS.txt | ||
| configure | ||
| Dockerfile.builds | ||
| Dockerfile.cov | ||
| Dockerfile.pkg | ||
| Dockerfile.test | ||