diff --git a/psiphon/common/parameters/parameters.go b/psiphon/common/parameters/parameters.go index 759f5130e..5bb6309cd 100644 --- a/psiphon/common/parameters/parameters.go +++ b/psiphon/common/parameters/parameters.go @@ -1239,6 +1239,15 @@ func (p *Parameters) Set( } inproxyAllCommonCompartmentIDs, _ := inproxyAllCommonCompartmentIDsValue.([]string) + // Special case: skip validation of transforms.Specs on the client side, + // since the regen operations may be slow. transforms.Specs are still + // validated on the server side, before being sent to clients. If a + // client's transforms.Spec is somehow corrupted, the tunnel dial + // applying the transform will error out -- transforms.Specs.Validate + // simply invokes the same apply operations. + + validateTransformSpecs := serverSide + for i := 0; i < len(applyParameters); i++ { count := 0 @@ -1431,6 +1440,11 @@ func (p *Parameters) Set( return nil, errors.Trace(err) } case transforms.Specs: + + if !validateTransformSpecs { + break + } + prefixMode := false if name == OSSHPrefixSpecs || name == ServerOSSHPrefixSpecs { prefixMode = true diff --git a/psiphon/common/tactics/tactics.go b/psiphon/common/tactics/tactics.go index 0aeb34792..fff5629b3 100644 --- a/psiphon/common/tactics/tactics.go +++ b/psiphon/common/tactics/tactics.go @@ -191,7 +191,7 @@ const ( AGGREGATION_MINIMUM = "Minimum" AGGREGATION_MAXIMUM = "Maximum" AGGREGATION_MEDIAN = "Median" - PAYLOAD_CACHE_SIZE = 256 + PAYLOAD_CACHE_SIZE = 1024 ) var ( diff --git a/psiphon/server/tactics.go b/psiphon/server/tactics.go index 78ea0e14a..fd369b3c2 100644 --- a/psiphon/server/tactics.go +++ b/psiphon/server/tactics.go @@ -136,7 +136,7 @@ func (c *ServerTacticsParametersCache) Get( // Construct parameters from tactics. // Note: since ServerTacticsParametersCache was implemented, - // tactics.Server.cachedTacticsData was added. This new cache is + // tactics.Server.cachedTacticsData was added. That new cache is // primarily intended to reduce server allocations and computations // when _clients_ request tactics. cachedTacticsData also impacts // GetTacticsWithTag. @@ -157,8 +157,6 @@ func (c *ServerTacticsParametersCache) Get( return nilAccessor, nil } - // Tactics.Probability is ignored for server-side tactics. - params, err := parameters.NewParameters(nil) if err != nil { return nilAccessor, errors.Trace(err)