Bladeren bron

Remove PSIPHON_ENABLE_DSL_CLIENT conditional build tag

Rod Hynes 2 maanden geleden
bovenliggende
commit
3064613a5b

+ 1 - 2
psiphon/common/tactics/tactics.go

@@ -1631,7 +1631,6 @@ func FetchTactics(
 	params *parameters.Parameters,
 	storer Storer,
 	getNetworkID func() string,
-	compressTacticsEnabled bool,
 	apiParams common.APIParameters,
 	endPointRegion string,
 	endPointProtocol string,
@@ -1642,7 +1641,7 @@ func FetchTactics(
 	p := params.Get()
 	speedTestPaddingMinBytes := p.Int(parameters.SpeedTestPaddingMinBytes)
 	speedTestPaddingMaxBytes := p.Int(parameters.SpeedTestPaddingMaxBytes)
-	compressTactics := compressTacticsEnabled && p.Bool(parameters.CompressTactics)
+	compressTactics := p.Bool(parameters.CompressTactics)
 	p.Close()
 
 	networkID := getNetworkID()

+ 0 - 8
psiphon/common/tactics/tactics_test.go

@@ -156,8 +156,6 @@ func TestTactics(t *testing.T) {
 
 	expectedApplyCount := 3
 
-	compressTacticsEnabled := true
-
 	tacticsConfig := fmt.Sprintf(
 		tacticsConfigTemplate,
 		encodedRequestPublicKey,
@@ -383,7 +381,6 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
-		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -460,7 +457,6 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
-		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -543,7 +539,6 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
-		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -677,7 +672,6 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
-		compressTacticsEnabled,
 		apiParams2,
 		endPointProtocol,
 		endPointRegion,
@@ -748,7 +742,6 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
-		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,
@@ -764,7 +757,6 @@ func TestTactics(t *testing.T) {
 		params,
 		storer,
 		getNetworkID,
-		compressTacticsEnabled,
 		apiParams,
 		endPointProtocol,
 		endPointRegion,

+ 1 - 3
psiphon/controller.go

@@ -3421,7 +3421,7 @@ func (controller *Controller) inproxyGetProxyAPIParameters(includeTacticsParamet
 		}
 
 		p := controller.config.GetParameters().Get()
-		compressTactics := compressTacticsEnabled && p.Bool(parameters.CompressTactics)
+		compressTactics := p.Bool(parameters.CompressTactics)
 		p.Close()
 
 		if compressTactics {
@@ -3566,5 +3566,3 @@ func (controller *Controller) inproxyHandleProxyTacticsPayload(
 
 	return appliedNewTactics
 }
-
-var compressTacticsEnabled = true

+ 0 - 6
psiphon/dsl.go

@@ -1,5 +1,3 @@
-//go:build PSIPHON_ENABLE_DSL_CLIENT
-
 /*
  * Copyright (c) 2025, Psiphon Inc.
  * All rights reserved.
@@ -33,10 +31,6 @@ import (
 	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/protocol"
 )
 
-func DSLEnabled() bool {
-	return true
-}
-
 func runUntunneledDSLFetcher(
 	ctx context.Context,
 	config *Config,

+ 0 - 48
psiphon/dsl_disabled.go

@@ -1,48 +0,0 @@
-//go:build !PSIPHON_ENABLE_DSL_CLIENT
-
-/*
- * Copyright (c) 2025, Psiphon Inc.
- * All rights reserved.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package psiphon
-
-import (
-	"context"
-)
-
-func DSLEnabled() bool {
-	return false
-}
-
-func runUntunneledDSLFetcher(
-	_ context.Context,
-	_ *Config,
-	_ *InproxyBrokerClientManager,
-	_ <-chan struct{}) {
-}
-
-func runTunneledDSLFetcher(
-	_ context.Context,
-	_ *Config,
-	_ func() *Tunnel,
-	_ <-chan struct{}) {
-}
-
-func init() {
-	compressTacticsEnabled = false
-}

+ 1 - 1
psiphon/server/server_test.go

@@ -911,7 +911,7 @@ func runServer(t *testing.T, runConfig *runServerConfig) {
 	// configureDSLTestServerEntries bootstrap can only perform tactics
 	// requests and not dial a tunnel, so the DSL request must succeed.
 
-	doDSL := psiphon.DSLEnabled() && doInproxy && inproxyTestConfig.addMeekServerForBroker
+	doDSL := doInproxy && inproxyTestConfig.addMeekServerForBroker
 
 	var dslTestConfig *dslTestConfig
 	enableDSLFetcher := "false"

+ 1 - 1
psiphon/serverApi.go

@@ -185,7 +185,7 @@ func (serverContext *ServerContext) doHandshakeRequest(ignoreStatsRegexps bool)
 		}
 
 		p := serverContext.tunnel.config.GetParameters().Get()
-		compressTactics = compressTacticsEnabled && p.Bool(parameters.CompressTactics)
+		compressTactics = p.Bool(parameters.CompressTactics)
 		p.Close()
 	}
 

+ 0 - 1
psiphon/tactics.go

@@ -310,7 +310,6 @@ func fetchTactics(
 		config.GetParameters(),
 		GetTacticsStorer(config),
 		config.GetNetworkID,
-		compressTacticsEnabled,
 		apiParams,
 		serverEntry.Region,
 		dialParams.TunnelProtocol,