From 2a68c66704798bf956ac132ab8309212af7fd1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Aza=C3=B1a?= Date: Sun, 7 Apr 2024 20:32:51 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(Cargo.toml):=20bump=20version=20to?= =?UTF-8?q?=200.1.6=20for=20new=20release=20=E2=9C=A8=20(ls=5Fclient.rs):?= =?UTF-8?q?=20add=20LS=5Fdata=5Fadapter=20parameter=20to=20subscription=20?= =?UTF-8?q?request=20=E2=99=BB=EF=B8=8F=20(ls=5Fclient.rs):=20conditionall?= =?UTF-8?q?y=20remove=20LS=5Fdata=5Fadapter=20if=20empty=20to=20clean=20up?= =?UTF-8?q?=20request=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- src/ls_client.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8e076aa..55aad92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lightstreamer-client" -version = "0.1.5" +version = "0.1.6" edition = "2021" authors = ["Daniel López Azaña "] description = "A Rust client for Lightstreamer, designed to facilitate real-time communication with Lightstreamer servers." diff --git a/src/ls_client.rs b/src/ls_client.rs index 95cdfba..cfd365f 100644 --- a/src/ls_client.rs +++ b/src/ls_client.rs @@ -443,6 +443,7 @@ impl LightstreamerClient { // Prepare the subscription request. // let mut params: Vec<(&str, &str)> = vec![ + ("LS_data_adapter", &ls_data_adapter), ("LS_reqId", &ls_req_id), ("LS_op", "add"), ("LS_subId", &ls_sub_id), @@ -451,6 +452,10 @@ impl LightstreamerClient { ("LS_schema", &ls_schema), ("LS_ack", "false"), ]; + // Remove the data adapter parameter if not specified. + if ls_data_adapter == "" { + params.remove(0); + } if ls_snapshot != "" { params.push(("LS_snapshot", &ls_snapshot)); }