Skip to content

Commit

Permalink
fix: add cancel for request_channel (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjeffcaii authored Feb 16, 2022
1 parent 4f58f3c commit f0ecbcf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/socket/duplex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package socket

import (
"context"
"fmt"
"runtime"
"sync"
"time"
Expand Down Expand Up @@ -816,8 +817,10 @@ func (dc *DuplexConnection) onFrameCancel(frame core.BufferedFrame) (err error)
vv.su.Cancel()
case requestStreamCallbackReverse:
vv.su.Cancel()
case requestChannelCallback:
vv.snd.Cancel()
default:
panic("cannot cancel")
panic(fmt.Sprintf("cannot cancel for callback type %T!", vv))
}

return
Expand Down

0 comments on commit f0ecbcf

Please sign in to comment.