Przeglądaj źródła

Fix: actually stop and log stats for clients on server shutdown

Rod Hynes 9 lat temu
rodzic
commit
af01f71fef
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      psiphon/server/tunnelServer.go

+ 2 - 1
psiphon/server/tunnelServer.go

@@ -343,10 +343,11 @@ func (sshServer *sshServer) stopClients() {
 
 
 	sshServer.clientsMutex.Lock()
 	sshServer.clientsMutex.Lock()
 	sshServer.stoppingClients = true
 	sshServer.stoppingClients = true
+	clients := sshServer.clients
 	sshServer.clients = make(map[sshClientID]*sshClient)
 	sshServer.clients = make(map[sshClientID]*sshClient)
 	sshServer.clientsMutex.Unlock()
 	sshServer.clientsMutex.Unlock()
 
 
-	for _, client := range sshServer.clients {
+	for _, client := range clients {
 		client.stop()
 		client.stop()
 	}
 	}
 }
 }