mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
more peer migration
This commit is contained in:
parent
775fb535dc
commit
88161009e9
3 changed files with 11 additions and 7 deletions
|
@ -219,9 +219,15 @@ func (p *peer) linkLoop() {
|
|||
}
|
||||
}
|
||||
|
||||
func (p *peer) handlePacketFrom(from phony.IActor, packet []byte) {
|
||||
p.EnqueueFrom(from, func() {
|
||||
p._handlePacket(packet)
|
||||
})
|
||||
}
|
||||
|
||||
// Called to handle incoming packets.
|
||||
// Passes the packet to a handler for that packet type.
|
||||
func (p *peer) handlePacket(packet []byte) {
|
||||
func (p *peer) _handlePacket(packet []byte) {
|
||||
// FIXME this is off by stream padding and msg length overhead, should be done in tcp.go
|
||||
atomic.AddUint64(&p.bytesRecvd, uint64(len(packet)))
|
||||
pType, pTypeLen := wire_decode_uint64(packet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue