Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

fix: Stop infinite read loop on control channel #338

Merged
merged 1 commit into from
May 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Stop infinite read loop on control channel
  • Loading branch information
kylecarbs committed May 9, 2021
commit 1230e8c4b84a595f25c5fb7bfcdb86d60a6798f4
3 changes: 3 additions & 0 deletions wsnet/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ func (l *listener) handle(dc *webrtc.DataChannel) {
d := make([]byte, 1)
for {
_, err = rw.Read(d)
if errors.Is(err, io.EOF) {
return
}
if err != nil {
continue
}
Expand Down