You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
srs/trunk
Winlin 05c3a422a5
HTTP-FLV: Notify connection to expire when unpublishing. v6.0.152 v7.0.11 (#4164)
When stopping the stream, it will wait for the HTTP Streaming to exit.
If the HTTP Streaming goroutine hangs, it will not exit automatically.

```cpp
void SrsHttpStreamServer::http_unmount(SrsRequest* r)
{
    SrsUniquePtr<SrsLiveStream> stream(entry->stream);
    if (stream->entry) stream->entry->enabled = false;
    srs_usleep(...); // Wait for about 120s.
    mux.unhandle(entry->mount, stream.get()); // Free stream.
}

srs_error_t SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{
    err = do_serve_http(w, r); // If stuck in here for 120s+
    alive_viewers_--; // Crash at here, because stream has been deleted.
```

We should notify http stream connection to interrupt(expire):

```cpp
void SrsHttpStreamServer::http_unmount(SrsRequest* r)
{
    SrsUniquePtr<SrsLiveStream> stream(entry->stream);
    if (stream->entry) stream->entry->enabled = false;
    stream->expire(); // Notify http stream to interrupt.
```

Note that we should notify all viewers pulling stream from this http
stream.

Note that we have tried to fix this issue, but only try to wait for all
viewers to quit, without interrupting the viewers, see
https://github.com/ossrs/srs/pull/4144


---------

Co-authored-by: Jacob Su <suzp1984@gmail.com>
5 months ago
..
3rdparty ASAN: Support coroutine context switching and stack tracing (#4153) 6 months ago
auto Fix crash when quiting. v6.0.151 v7.0.10 (#4157) 6 months ago
conf GB28181: Support external SIP server. v6.0.144 (#4101) 7 months ago
doc HTTP-FLV: Notify connection to expire when unpublishing. v6.0.152 v7.0.11 (#4164) 5 months ago
etc/init.d Squash: Fix bugs 3 years ago
gdb The identifier "ShowCouroutines" needs to be modified to "ShowCoroutines" in order to rectify the typographical error. v6.0.63 (#3703) 2 years ago
ide/srs_clion UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 (#4109) 7 months ago
modules Moduels: Refine the description 4 years ago
packaging Windows: Refine cygwin pipeline (#3260) 2 years ago
research ASAN: Support coroutine context switching and stack tracing (#4153) 6 months ago
scripts UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 (#4109) 7 months ago
src HTTP-FLV: Notify connection to expire when unpublishing. v6.0.152 v7.0.11 (#4164) 5 months ago
usr/lib/systemd/system Squash: Support RPM. Fix bugs. 3 years ago
.gitignore For #2136: API: Cleanup no active streams for statistics. v5.0.42 3 years ago
AUTHORS.md Update contributors. 1 year ago
AUTHORS.txt Update AUTHORS 4 years ago
Dockerfile.builds Use new cache image name. v6.0.86 (#3815) 1 year ago
Dockerfile.cov Asan: Refine asan warning message for macOS. 2 years ago
Dockerfile.pkg Merge branch v5.0.103 into develop 2 years ago
Dockerfile.test Fix opus delay options, use ffmpeg-opus in docker test. v6.0.102 (#3883) 1 year ago
configure ASAN: Support coroutine context switching and stack tracing (#4153) 6 months ago