mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2024-11-21 23:03:08 +01:00
Fix bug: faststart and fastping not working
This commit is contained in:
parent
350a7e43f6
commit
2a27f7b463
@ -383,7 +383,11 @@ func NewDevice(tapDevice tap.Device, id mtypes.Vertex, bind conn.Bind, logger *L
|
||||
go device.RoutineClearL2FIB()
|
||||
go device.RoutineRecalculateNhTable()
|
||||
go device.RoutinePostPeerInfo(device.Chan_HttpPostStart)
|
||||
|
||||
go func() {
|
||||
<-device.Chan_Supernode_OK
|
||||
device.Chan_SendRegisterStart <- struct{}{}
|
||||
}()
|
||||
|
||||
}
|
||||
|
||||
// create queues
|
||||
|
@ -134,7 +134,7 @@ func (et *endpoint_trylist) GetNextTry() (bool, string) {
|
||||
return false, ""
|
||||
}
|
||||
smallest.lastTry = time.Now()
|
||||
if smallest.firstTry.After(time.Time{}) {
|
||||
if !smallest.firstTry.After(time.Time{}) {
|
||||
smallest.firstTry = time.Now()
|
||||
}
|
||||
if smallest.firstTry.Add(et.timeout).Before(time.Now()) {
|
||||
|
@ -771,6 +771,9 @@ func (device *Device) RoutineSetEndpoint() {
|
||||
}
|
||||
if FastTry {
|
||||
NextRun = true
|
||||
if device.LogLevel.LogControl {
|
||||
fmt.Printf("Control: First try for peer %v at endpoint %v, sending hole-punching ping\n", thepeer.ID.ToString(), connurl)
|
||||
}
|
||||
go device.SendPing(thepeer, int(device.EdgeConfig.DynamicRoute.ConnNextTry+1), 1, 1)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user