Skip to content

Commit 6950492

Browse files
committed
envconfig: re-add AdvertiseCompressors temporarily
1 parent 70f1a40 commit 6950492

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/envconfig/envconfig.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ import (
2828
var (
2929
// TXTErrIgnore is set if TXT errors should be ignored ("GRPC_GO_IGNORE_TXT_ERRORS" is not "false").
3030
TXTErrIgnore = boolFromEnv("GRPC_GO_IGNORE_TXT_ERRORS", true)
31+
// AdvertiseCompressors is set if registered compressor should be advertised
32+
// ("GRPC_GO_ADVERTISE_COMPRESSORS" is not "false").
33+
AdvertiseCompressors = boolFromEnv("GRPC_GO_ADVERTISE_COMPRESSORS", true)
3134
// RingHashCap indicates the maximum ring size which defaults to 4096
3235
// entries but may be overridden by setting the environment variable
3336
// "GRPC_RING_HASH_CAP". This does not override the default bounds

internal/grpcutil/compressor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ func IsCompressorNameRegistered(name string) bool {
3838
// RegisteredCompressors returns a string of registered compressor names
3939
// separated by comma.
4040
func RegisteredCompressors() string {
41+
if !envconfig.AdvertiseCompressors {
42+
return ""
43+
}
4144
return strings.Join(RegisteredCompressorNames, ",")
4245
}

0 commit comments

Comments
 (0)