Add cl.IsTakenOver and switch cl.isTakenOver to atomic.Bool (#446)

* OnPublish CodeSuccessIgnore, use debug instead of error log

* Suppress OnPublish CodeSuccessIgnore error log

* Add cl.IsTakenOver and switch to use atomic.Bool

---------

Co-authored-by: JB <28275108+mochi-co@users.noreply.github.com>
This commit is contained in:
thedevop
2025-01-30 09:58:03 -08:00
committed by GitHub
parent dcb814cedf
commit 043906876e
5 changed files with 26 additions and 6 deletions

View File

@@ -599,6 +599,13 @@ func TestClientClosed(t *testing.T) {
require.True(t, cl.Closed())
}
func TestClientIsTakenOver(t *testing.T) {
cl, _, _ := newTestClient()
require.False(t, cl.IsTakenOver())
cl.State.isTakenOver.Store(true)
require.True(t, cl.IsTakenOver())
}
func TestClientReadFixedHeaderError(t *testing.T) {
cl, r, _ := newTestClient()
defer cl.Stop(errClientStop)