FSM logic cleanup
This commit is contained in:
parent
5844584219
commit
c6d35856bc
@ -172,7 +172,6 @@ func (r *remoteFSM) stateServer_onSyn(msg controlMsg[packetSyn]) {
|
|||||||
// Before we can respond to this packet, we need to make sure the
|
// Before we can respond to this packet, we need to make sure the
|
||||||
// route is setup properly.
|
// route is setup properly.
|
||||||
conf := r.conf()
|
conf := r.conf()
|
||||||
logSyn := !conf.Up || conf.Direct != p.Direct
|
|
||||||
|
|
||||||
conf.Up = true
|
conf.Up = true
|
||||||
conf.Direct = p.Direct
|
conf.Direct = p.Direct
|
||||||
@ -181,10 +180,7 @@ func (r *remoteFSM) stateServer_onSyn(msg controlMsg[packetSyn]) {
|
|||||||
conf.DataCipher = newDataCipherFromKey(p.SharedKey)
|
conf.DataCipher = newDataCipherFromKey(p.SharedKey)
|
||||||
|
|
||||||
r.updateConf(conf)
|
r.updateConf(conf)
|
||||||
|
r.logf("Got SYN.")
|
||||||
if logSyn {
|
|
||||||
r.logf("Got SYN.")
|
|
||||||
}
|
|
||||||
|
|
||||||
r.sendControl(conf, packetAck{
|
r.sendControl(conf, packetAck{
|
||||||
TraceID: p.TraceID,
|
TraceID: p.TraceID,
|
||||||
@ -316,7 +312,7 @@ func (r *remoteFSM) stateClientInit_onPing() stateFunc {
|
|||||||
|
|
||||||
func (r *remoteFSM) enterClient() stateFunc {
|
func (r *remoteFSM) enterClient() stateFunc {
|
||||||
conf := r.conf()
|
conf := r.conf()
|
||||||
r.probes = make(map[uint64]sentProbe, 8)
|
clear(r.probes)
|
||||||
|
|
||||||
r.traceID = r.NewTraceID()
|
r.traceID = r.NewTraceID()
|
||||||
r.stateClient_sendSyn(conf)
|
r.stateClient_sendSyn(conf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user