Browse Source

Add explicit DisableTactics config parameter

Rod Hynes 7 years ago
parent
commit
49b345980f
3 changed files with 9 additions and 2 deletions
  1. 4 0
      psiphon/config.go
  2. 2 1
      psiphon/controller.go
  3. 3 1
      psiphon/serverApi.go

+ 4 - 0
psiphon/config.go

@@ -226,6 +226,10 @@ type Config struct {
 	// This parameter is only applicable to library deployments.
 	NetworkIDGetter NetworkIDGetter
 
+	// DisableTactics disables tactics operations including requests, payload
+	// handling, and application of parameters.
+	DisableTactics bool
+
 	// TransformHostNames specifies whether to use hostname transformation
 	// circumvention strategies. Set to "always" to always transform, "never"
 	// to never transform, and "", the default, for the default transformation

+ 2 - 1
psiphon/controller.go

@@ -1182,7 +1182,8 @@ func (controller *Controller) launchEstablishing() {
 	// Any in-flight tactics request or pending retry will be
 	// canceled when establishment is stopped.
 
-	doTactics := (controller.config.NetworkIDGetter != nil)
+	doTactics := !controller.config.DisableTactics &&
+		controller.config.NetworkIDGetter != nil
 
 	if doTactics {
 

+ 3 - 1
psiphon/serverApi.go

@@ -125,7 +125,9 @@ func (serverContext *ServerContext) doHandshakeRequest(
 
 	params := serverContext.getBaseAPIParameters()
 
-	doTactics := serverContext.tunnel.config.NetworkIDGetter != nil
+	doTactics := !serverContext.tunnel.config.DisableTactics &&
+		serverContext.tunnel.config.NetworkIDGetter != nil
+
 	networkID := ""
 	if doTactics {