5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 22:20:27 +00:00

actually use doCancel in writeNoCopy

This commit is contained in:
Arceliar 2019-10-05 12:23:21 -05:00
parent 83e3a24423
commit c38e40e8e3

View File

@ -292,6 +292,9 @@ func (c *Conn) writeNoCopy(msg FlowKeyMessage) error {
var cancel util.Cancellation var cancel util.Cancellation
var doCancel bool var doCancel bool
phony.Block(c, func() { cancel, doCancel = c._getDeadlineCancellation(c.writeDeadline) }) phony.Block(c, func() { cancel, doCancel = c._getDeadlineCancellation(c.writeDeadline) })
if doCancel {
defer cancel.Cancel(nil)
}
var err error var err error
select { select {
case <-cancel.Finished(): case <-cancel.Finished():