mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-15 16:33:47 +00:00
only cache talk request
This commit is contained in:
parent
618559ee75
commit
b1fa06e1a2
1 changed files with 22 additions and 17 deletions
|
|
@ -600,7 +600,12 @@ func (t *UDPv5) dispatch() {
|
||||||
t.sendNextCall(c.id)
|
t.sendNextCall(c.id)
|
||||||
|
|
||||||
case r := <-t.sendCh:
|
case r := <-t.sendCh:
|
||||||
// make send request by another thread also be cached to handle WHOAREYOU
|
if _, ok := r.msg.(*v5wire.TalkResponse); ok {
|
||||||
|
// send a TalkResponse out
|
||||||
|
t.send(r.destID, r.destAddr, r.msg, nil)
|
||||||
|
} else {
|
||||||
|
// send out a TalkRequest that is a UTP packet for portal network
|
||||||
|
// request should be cached to handle WHOAREYOU
|
||||||
c := &callV5{id: r.destID, addr: r.destAddr}
|
c := &callV5{id: r.destID, addr: r.destAddr}
|
||||||
c.node = r.destNode
|
c.node = r.destNode
|
||||||
c.packet = r.msg
|
c.packet = r.msg
|
||||||
|
|
@ -618,7 +623,7 @@ func (t *UDPv5) dispatch() {
|
||||||
c.nonce = nonce
|
c.nonce = nonce
|
||||||
t.activeCallByAuth[nonce] = c
|
t.activeCallByAuth[nonce] = c
|
||||||
t.startResponseTimeout(c)
|
t.startResponseTimeout(c)
|
||||||
|
}
|
||||||
case p := <-t.packetInCh:
|
case p := <-t.packetInCh:
|
||||||
t.handlePacket(p.Data, p.Addr)
|
t.handlePacket(p.Data, p.Addr)
|
||||||
// Arm next read.
|
// Arm next read.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue