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

Commit bb4ced4

Browse files
authored
fix: Stop infinite read loop on control channel (#338)
1 parent ed0464a commit bb4ced4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wsnet/listen.go

+3
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ func (l *listener) handle(dc *webrtc.DataChannel) {
226226
d := make([]byte, 1)
227227
for {
228228
_, err = rw.Read(d)
229+
if errors.Is(err, io.EOF) {
230+
return
231+
}
229232
if err != nil {
230233
continue
231234
}

0 commit comments

Comments
 (0)