Skip to content

Commit f0ecbcf

Browse files
authored
fix: add cancel for request_channel (#120)
1 parent 4f58f3c commit f0ecbcf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/socket/duplex.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package socket
22

33
import (
44
"context"
5+
"fmt"
56
"runtime"
67
"sync"
78
"time"
@@ -816,8 +817,10 @@ func (dc *DuplexConnection) onFrameCancel(frame core.BufferedFrame) (err error)
816817
vv.su.Cancel()
817818
case requestStreamCallbackReverse:
818819
vv.su.Cancel()
820+
case requestChannelCallback:
821+
vv.snd.Cancel()
819822
default:
820-
panic("cannot cancel")
823+
panic(fmt.Sprintf("cannot cancel for callback type %T!", vv))
821824
}
822825

823826
return

0 commit comments

Comments
 (0)