jsonrpc: Correctly cancel server-side contexts on lost connection
This commit is contained in:
parent
971282a9a5
commit
4014cbdb44
@ -436,13 +436,14 @@ func (c *wsConn) closeInFlight() {
|
|||||||
Code: 2,
|
Code: 2,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
c.handlingLk.Lock()
|
c.handlingLk.Lock()
|
||||||
for _, cancel := range c.handling {
|
for _, cancel := range c.handling {
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
c.handlingLk.Unlock()
|
c.handlingLk.Unlock()
|
||||||
}
|
|
||||||
c.inflight = map[int64]clientRequest{}
|
c.inflight = map[int64]clientRequest{}
|
||||||
c.handling = map[int64]context.CancelFunc{}
|
c.handling = map[int64]context.CancelFunc{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user