Browse Source

update TCPKeepAliveInterval type to allow expression disable

Shelikhoo 4 years ago
parent
commit
31a7fb503c

+ 1 - 1
infra/conf/transport_internet.go

@@ -390,7 +390,7 @@ type SocketConfig struct {
 	TProxy              string `json:"tproxy"`
 	TProxy              string `json:"tproxy"`
 	AcceptProxyProtocol bool   `json:"acceptProxyProtocol"`
 	AcceptProxyProtocol bool   `json:"acceptProxyProtocol"`
 
 
-	TCPKeepAliveInterval uint32 `json:"tcpKeepAliveInterval"`
+	TCPKeepAliveInterval int32 `json:"tcpKeepAliveInterval"`
 }
 }
 
 
 // Build implements Buildable.
 // Build implements Buildable.

+ 3 - 3
transport/internet/config.pb.go

@@ -420,7 +420,7 @@ type SocketConfig struct {
 	BindAddress                []byte `protobuf:"bytes,5,opt,name=bind_address,json=bindAddress,proto3" json:"bind_address,omitempty"`
 	BindAddress                []byte `protobuf:"bytes,5,opt,name=bind_address,json=bindAddress,proto3" json:"bind_address,omitempty"`
 	BindPort                   uint32 `protobuf:"varint,6,opt,name=bind_port,json=bindPort,proto3" json:"bind_port,omitempty"`
 	BindPort                   uint32 `protobuf:"varint,6,opt,name=bind_port,json=bindPort,proto3" json:"bind_port,omitempty"`
 	AcceptProxyProtocol        bool   `protobuf:"varint,7,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"`
 	AcceptProxyProtocol        bool   `protobuf:"varint,7,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"`
-	TcpKeepAliveInterval       uint32 `protobuf:"varint,8,opt,name=tcp_keep_alive_interval,json=tcpKeepAliveInterval,proto3" json:"tcp_keep_alive_interval,omitempty"`
+	TcpKeepAliveInterval       int32  `protobuf:"varint,8,opt,name=tcp_keep_alive_interval,json=tcpKeepAliveInterval,proto3" json:"tcp_keep_alive_interval,omitempty"`
 }
 }
 
 
 func (x *SocketConfig) Reset() {
 func (x *SocketConfig) Reset() {
@@ -504,7 +504,7 @@ func (x *SocketConfig) GetAcceptProxyProtocol() bool {
 	return false
 	return false
 }
 }
 
 
-func (x *SocketConfig) GetTcpKeepAliveInterval() uint32 {
+func (x *SocketConfig) GetTcpKeepAliveInterval() int32 {
 	if x != nil {
 	if x != nil {
 		return x.TcpKeepAliveInterval
 		return x.TcpKeepAliveInterval
 	}
 	}
@@ -591,7 +591,7 @@ var file_transport_internet_config_proto_rawDesc = []byte{
 	0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79,
 	0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79,
 	0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x35, 0x0a, 0x17, 0x74, 0x63, 0x70, 0x5f,
 	0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x35, 0x0a, 0x17, 0x74, 0x63, 0x70, 0x5f,
 	0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72,
 	0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72,
-	0x76, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x74, 0x63, 0x70, 0x4b, 0x65,
+	0x76, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x74, 0x63, 0x70, 0x4b, 0x65,
 	0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22,
 	0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22,
 	0x35, 0x0a, 0x10, 0x54, 0x43, 0x50, 0x46, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74,
 	0x35, 0x0a, 0x10, 0x54, 0x43, 0x50, 0x46, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74,
 	0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x73, 0x49, 0x73, 0x10, 0x00, 0x12, 0x0a, 0x0a,
 	0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x73, 0x49, 0x73, 0x10, 0x00, 0x12, 0x0a, 0x0a,

+ 1 - 1
transport/internet/config.proto

@@ -92,5 +92,5 @@ message SocketConfig {
 
 
   bool accept_proxy_protocol = 7;
   bool accept_proxy_protocol = 7;
 
 
-  uint32 tcp_keep_alive_interval = 8;
+  int32 tcp_keep_alive_interval = 8;
 }
 }