aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-04-03 08:16:53 +0800
committerFelix Lange <fjl@twurst.com>2015-04-10 19:26:27 +0800
commit9cd8c96157728b8e2eb98a5c506abfc543b6e166 (patch)
treed447713167c790ca65fec798087dceff3b97582f
parentfc1d1f9afd155fab1f614c6a0340233f90afafd6 (diff)
downloaddexon-9cd8c96157728b8e2eb98a5c506abfc543b6e166.tar
dexon-9cd8c96157728b8e2eb98a5c506abfc543b6e166.tar.gz
dexon-9cd8c96157728b8e2eb98a5c506abfc543b6e166.tar.bz2
dexon-9cd8c96157728b8e2eb98a5c506abfc543b6e166.tar.lz
dexon-9cd8c96157728b8e2eb98a5c506abfc543b6e166.tar.xz
dexon-9cd8c96157728b8e2eb98a5c506abfc543b6e166.tar.zst
dexon-9cd8c96157728b8e2eb98a5c506abfc543b6e166.zip
p2p/discover: make packet processing less concurrent
-rw-r--r--p2p/discover/udp.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go
index a638a8f35..3275cf128 100644
--- a/p2p/discover/udp.go
+++ b/p2p/discover/udp.go
@@ -379,11 +379,9 @@ func (t *udp) readLoop() {
continue
}
glog.V(logger.Detail).Infof("<<< %v %T %v\n", from, packet, packet)
- go func() {
- if err := packet.handle(t, from, fromID, hash); err != nil {
- glog.V(logger.Debug).Infof("error handling %T from %v: %v", packet, from, err)
- }
- }()
+ if err := packet.handle(t, from, fromID, hash); err != nil {
+ glog.V(logger.Debug).Infof("error handling %T from %v: %v", packet, from, err)
+ }
}
}
@@ -430,7 +428,7 @@ func (req *ping) handle(t *udp, from *net.UDPAddr, fromID NodeID, mac []byte) er
})
if !t.handleReply(fromID, pingPacket, req) {
// Note: we're ignoring the provided IP address right now
- t.bond(true, fromID, from, req.Port)
+ go t.bond(true, fromID, from, req.Port)
}
return nil
}