Skip to content

Commit

Permalink
Merge pull request xmidt-org#177 from nlrcomcast/LTE-2033_Fix
Browse files Browse the repository at this point in the history
LTE-2033:webconfig URL keeps mac as text instead of xle mac value fix
  • Loading branch information
sadhyama authored Sep 6, 2023
2 parents 078b7b2 + 2793611 commit b6f6f80
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/webcfg_multipart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/webcfg_rbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions src/webcfg_rbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b6f6f80

Please sign in to comment.