more peer migration

This commit is contained in:
Arceliar 2019-08-24 12:55:49 -05:00
parent 775fb535dc
commit 88161009e9
3 changed files with 11 additions and 7 deletions

View file

@ -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)