Просмотр исходного кода

Move tunnel.SetSessionStarted() to operateTunnel() for readability.

Rod Hynes 11 лет назад
Родитель
Сommit
78795b6e5d
2 измененных файлов с 3 добавлено и 2 удалено
  1. 3 0
      psiphon/controller.go
  2. 0 2
      psiphon/serverApi.go

+ 3 - 0
psiphon/controller.go

@@ -383,6 +383,9 @@ func (controller *Controller) operateTunnel(tunnel *Tunnel) {
 		err = fmt.Errorf("error starting session for %s: %s", tunnel.serverEntry.IpAddress, err)
 	}
 
+	// Tunnel may now be used for port forwarding
+	tunnel.SetSessionStarted()
+
 	// Promote this successful tunnel to first rank so it's one
 	// of the first candidates next time establish runs.
 	PromoteServerEntry(tunnel.serverEntry.IpAddress)

+ 0 - 2
psiphon/serverApi.go

@@ -68,8 +68,6 @@ func NewSession(config *Config, tunnel *Tunnel) (session *Session, err error) {
 		return nil, ContextError(err)
 	}
 
-	tunnel.SetSessionStarted()
-
 	return session, nil
 }