Jelajahi Sumber

adding validation for the tpc keepalive client config

eric 10 tahun lalu
induk
melakukan
8c2e14cb19
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. 2 0
      config.go

+ 2 - 0
config.go

@@ -190,6 +190,8 @@ func (c *Config) Validate() error {
 		return ConfigurationError("Invalid Net.ReadTimeout, must be > 0")
 	case c.Net.WriteTimeout <= 0:
 		return ConfigurationError("Invalid Net.WriteTimeout, must be > 0")
+	case c.Net.KeepAlive < 0:
+		return ConfigurationError("Invalid Net.KeepAlive, must be > 0")
 	}
 
 	// validate the Metadata values