diff options
author | Didier Wenzek <didier.wenzek@acidalie.com> | 2021-09-14 17:29:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 17:29:51 +0100 |
commit | 71ba065980c97f71d92366e4fd620b642ab85743 (patch) | |
tree | cc153bf5e48b9aa44c03f713a51ee35a7a2b4f43 /tedge | |
parent | ac5beefb5d9fae73281b667d6719644691eeef82 (diff) |
Fix the bridge configuration of the clean session flag (#426)
* Fix bridge config: the session must not been clean on re-connect
* Fix function scope
Co-authored-by: Wenzek <diw@softwareag.com>
Diffstat (limited to 'tedge')
-rw-r--r-- | tedge/src/cli/connect/bridge_config.rs | 43 | ||||
-rw-r--r-- | tedge/src/cli/connect/bridge_config_azure.rs | 4 | ||||
-rw-r--r-- | tedge/src/cli/connect/bridge_config_c8y.rs | 4 |
3 files changed, 26 insertions, 25 deletions
diff --git a/tedge/src/cli/connect/bridge_config.rs b/tedge/src/cli/connect/bridge_config.rs index 0c45775b..3bd70972 100644 --- a/tedge/src/cli/connect/bridge_config.rs +++ b/tedge/src/cli/connect/bridge_config.rs @@ -348,26 +348,27 @@ bridge_attempt_unsubscribe false Ok(()) } -} -fn default_bridge_config() -> BridgeConfig { - BridgeConfig { - cloud_name: "az/c8y".into(), - config_file: "cfg".to_string(), - connection: "edge_to_az/c8y".into(), - address: "".into(), - remote_username: None, - bridge_root_cert_path: "".into(), - bridge_certfile: "".into(), - bridge_keyfile: "".into(), - remote_clientid: "".into(), - local_clientid: "".into(), - use_mapper: true, - use_agent: true, - try_private: false, - start_type: "automatic".into(), - clean_session: true, - notifications: false, - bridge_attempt_unsubscribe: false, - topics: vec![], + + fn default_bridge_config() -> BridgeConfig { + BridgeConfig { + cloud_name: "az/c8y".into(), + config_file: "cfg".to_string(), + connection: "edge_to_az/c8y".into(), + address: "".into(), + remote_username: None, + bridge_root_cert_path: "".into(), + bridge_certfile: "".into(), + bridge_keyfile: "".into(), + remote_clientid: "".into(), + local_clientid: "".into(), + use_mapper: true, + use_agent: true, + try_private: false, + start_type: "automatic".into(), + clean_session: true, + notifications: false, + bridge_attempt_unsubscribe: false, + topics: vec![], + } } } diff --git a/tedge/src/cli/connect/bridge_config_azure.rs b/tedge/src/cli/connect/bridge_config_azure.rs index c126e4de..0aa5ac1b 100644 --- a/tedge/src/cli/connect/bridge_config_azure.rs +++ b/tedge/src/cli/connect/bridge_config_azure.rs @@ -50,7 +50,7 @@ impl From<BridgeConfigAzureParams> for BridgeConfig { use_agent: false, try_private: false, start_type: "automatic".into(), - clean_session: true, + clean_session: false, notifications: false, bridge_attempt_unsubscribe: false, topics: vec![ @@ -100,7 +100,7 @@ fn test_bridge_config_from_azure_params() -> anyhow::Result<()> { ], try_private: false, start_type: "automatic".into(), - clean_session: true, + clean_session: false, notifications: false, bridge_attempt_unsubscribe: false, }; diff --git a/tedge/src/cli/connect/bridge_config_c8y.rs b/tedge/src/cli/connect/bridge_config_c8y.rs index e95efd0d..574b1543 100644 --- a/tedge/src/cli/connect/bridge_config_c8y.rs +++ b/tedge/src/cli/connect/bridge_config_c8y.rs @@ -40,7 +40,7 @@ impl From<BridgeConfigC8yParams> for BridgeConfig { use_agent: true, try_private: false, start_type: "automatic".into(), - clean_session: true, + clean_session: false, notifications: false, bridge_attempt_unsubscribe: false, topics: vec![ @@ -133,7 +133,7 @@ fn test_bridge_config_from_c8y_params() -> anyhow::Result<()> { ], try_private: false, start_type: "automatic".into(), - clean_session: true, + clean_session: false, notifications: false, bridge_attempt_unsubscribe: false, }; |