From 27936113ac5618e5b2eea6527071ab94deb7fc89 Mon Sep 17 00:00:00 2001 From: nlaksh787 Date: Mon, 4 Sep 2023 22:06:09 +0530 Subject: [PATCH] LTE-2033:webconfig URL keeps mac as text instead of xle mac value fix --- src/webcfg_multipart.c | 25 ++++++++++++++++++++++--- src/webcfg_rbus.c | 12 ++++++++++++ src/webcfg_rbus.h | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/webcfg_multipart.c b/src/webcfg_multipart.c index 54a0e965..2b60ef09 100644 --- a/src/webcfg_multipart.c +++ b/src/webcfg_multipart.c @@ -217,7 +217,8 @@ WEBCFG_STATUS webcfg_http_request(char **configData, int r_count, int status, lo char configURL[256] = { 0 }; char c[] = "{mac}"; int rv = 0; - + int rc = -1; + int content_res=0; struct token_data data; data.size = 0; @@ -282,11 +283,29 @@ WEBCFG_STATUS webcfg_http_request(char **configData, int r_count, int status, lo webConfigURL = replaceMacWord(configURL, c, get_deviceMAC()); if(get_global_supplementarySync() == 0) { - Set_Webconfig_URL(webConfigURL); + rc = Set_Webconfig_URL(webConfigURL); + if(rc == RBUS_ERROR_SUCCESS) + { + set_global_webconfig_url(webConfigURL); + WebcfgInfo("Global set Webconfig URL:%s\n",webConfigURL); + } + else + { + WebcfgError("Failed to set Webconfig URL\n"); + } } else { - Set_Supplementary_URL(docname_upper, webConfigURL); + rc = Set_Supplementary_URL(docname_upper, webConfigURL); + if(rc == RBUS_ERROR_SUCCESS) + { + set_global_supplementary_url(webConfigURL); + WebcfgInfo("Global set Supplementary URL:%s\n",webConfigURL); + } + else + { + WebcfgError("Failed to set Supplementary URL\n"); + } } } else diff --git a/src/webcfg_rbus.c b/src/webcfg_rbus.c index e8a9972f..60e0ec53 100755 --- a/src/webcfg_rbus.c +++ b/src/webcfg_rbus.c @@ -2211,3 +2211,15 @@ void registerRbusLogger() rbus_registerLogHandler(rbus_log_handler); WebcfgDebug("Registered rbus log handler\n"); } + +void set_global_webconfig_url(char *value) +{ + WEBCFG_FREE(URLVal); + URLVal = strdup(value); +} + +void set_global_supplementary_url(char *value) +{ + WEBCFG_FREE(SupplementaryURLVal); + SupplementaryURLVal = strdup(value); +} diff --git a/src/webcfg_rbus.h b/src/webcfg_rbus.h index 695449f9..402e273a 100755 --- a/src/webcfg_rbus.h +++ b/src/webcfg_rbus.h @@ -115,6 +115,8 @@ rbusError_t removeRBUSEventElement(); rbusError_t rbusWebcfgEventHandler(rbusHandle_t handle, rbusProperty_t prop, rbusSetHandlerOptions_t* opts); int set_rbus_RfcEnable(bool bValue); int set_rbus_ForceSync(char* pString, int *pStatus); +void set_global_webconfig_url(char *value); +void set_global_supplementary_url(char *value); int parseForceSyncJson(char *jsonpayload, char **forceSyncVal, char **forceSynctransID); int get_rbus_ForceSync(char** pString, char **transactionId ); bool get_rbus_RfcEnable();