diff --git a/pkg/sdp/sdp_test.go b/pkg/sdp/sdp_test.go index d50796c4..9accfba8 100644 --- a/pkg/sdp/sdp_test.go +++ b/pkg/sdp/sdp_test.go @@ -565,7 +565,7 @@ var cases = []struct { }, }, { - "live reporter app", + "issue mediamtx/75", []byte("v=0\r\n" + "o=-0 0 IN IP4 127.0.0.1\r\n" + "s=No Name\r\n" + diff --git a/server_test.go b/server_test.go index a7a52546..b21d8157 100644 --- a/server_test.go +++ b/server_test.go @@ -4,6 +4,7 @@ import ( "fmt" "net" "testing" + "time" "github.com/stretchr/testify/require" @@ -843,12 +844,16 @@ func TestServerSessionClose(t *testing.T) { defer stream.Close() var session *ServerSession + connClosed := make(chan struct{}) s := &Server{ Handler: &testServerHandler{ onSessionOpen: func(ctx *ServerHandlerOnSessionOpenCtx) { session = ctx.Session }, + onConnClose: func(ctx *ServerHandlerOnConnCloseCtx) { + close(connClosed) + }, onDescribe: func(ctx *ServerHandlerOnDescribeCtx) (*base.Response, *ServerStream, error) { return &base.Response{ StatusCode: base.StatusOK, @@ -892,6 +897,12 @@ func TestServerSessionClose(t *testing.T) { session.Close() session.Close() + select { + case <-connClosed: + case <-time.After(2 * time.Second): + t.Errorf("should not happen") + } + _, err = writeReqReadRes(conn, base.Request{ Method: base.Options, URL: mustParseURL("rtsp://localhost:8554/"),