mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-25 19:31:37 +00:00
Fix data races in handleProto
(observed by @majestrate)
This commit is contained in:
parent
42d4298e19
commit
88a0a3e8fb
@ -65,10 +65,16 @@ func (p *protoHandler) handleProto(from phony.Actor, key keyArray, bs []byte) {
|
|||||||
case typeProtoNodeInfoResponse:
|
case typeProtoNodeInfoResponse:
|
||||||
p.nodeinfo.handleRes(p, key, bs[1:])
|
p.nodeinfo.handleRes(p, key, bs[1:])
|
||||||
case typeProtoDebug:
|
case typeProtoDebug:
|
||||||
p._handleDebug(key, bs[1:])
|
p.handleDebug(from, key, bs[1:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *protoHandler) handleDebug(from phony.Actor, key keyArray, bs []byte) {
|
||||||
|
p.Act(from, func() {
|
||||||
|
p._handleDebug(key, bs)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (p *protoHandler) _handleDebug(key keyArray, bs []byte) {
|
func (p *protoHandler) _handleDebug(key keyArray, bs []byte) {
|
||||||
if len(bs) == 0 {
|
if len(bs) == 0 {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user