-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: fix panic when writing packets after connection error (#681)
* Fix writer nullpointer panic on network reconnect * add additional code and tests --------- Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
- Loading branch information
1 parent
6240aa2
commit b2cfa93
Showing
5 changed files
with
44 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package gortsplib | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestAsyncProcessorStopAfterError(t *testing.T) { | ||
p := &asyncProcessor{bufferSize: 8} | ||
p.initialize() | ||
|
||
p.push(func() error { | ||
return fmt.Errorf("ok") | ||
}) | ||
|
||
p.start() | ||
|
||
<-p.stopped | ||
require.EqualError(t, p.stopError, "ok") | ||
|
||
p.stop() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters