mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 20:50:00 +00:00
TUN-5697: Listen for UpdateConfiguration RPC in quic transport
This commit is contained in:

committed by
Chung Ting Huang

parent
d78a5ba5da
commit
e56c4532ce
@@ -231,14 +231,18 @@ type mockConfigRPCServer struct {
|
||||
config []byte
|
||||
}
|
||||
|
||||
func (s mockConfigRPCServer) UpdateConfiguration(_ context.Context, version int32, config []byte) (*tunnelpogs.UpdateConfigurationResponse, error) {
|
||||
func (s mockConfigRPCServer) UpdateConfiguration(_ context.Context, version int32, config []byte) *tunnelpogs.UpdateConfigurationResponse {
|
||||
if s.version != version {
|
||||
return nil, fmt.Errorf("expect version %d, got %d", s.version, version)
|
||||
return &tunnelpogs.UpdateConfigurationResponse{
|
||||
Err: fmt.Errorf("expect version %d, got %d", s.version, version),
|
||||
}
|
||||
}
|
||||
if !bytes.Equal(s.config, config) {
|
||||
return nil, fmt.Errorf("expect config %v, got %v", s.config, config)
|
||||
return &tunnelpogs.UpdateConfigurationResponse{
|
||||
Err: fmt.Errorf("expect config %v, got %v", s.config, config),
|
||||
}
|
||||
}
|
||||
return &tunnelpogs.UpdateConfigurationResponse{LastAppliedVersion: version}, nil
|
||||
return &tunnelpogs.UpdateConfigurationResponse{LastAppliedVersion: version}
|
||||
}
|
||||
|
||||
type mockRPCStream struct {
|
||||
|
Reference in New Issue
Block a user