Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain Webconfig root version to POST-NONE to handle NONE-REBOOT cases #226

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/webcfg_multipart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,13 +1410,7 @@ void derive_root_doc_version_string(char **rootVersion, uint32_t *root_ver, int

if(db_root_string !=NULL)
{
if((strcmp(db_root_string,"POST-NONE")==0) && (strcmp(g_RebootReason,FW_UPGRADE_REBOOT_REASON)!=0) && (strcmp(g_RebootReason,FORCED_FW_UPGRADE_REBOOT_REASON)!=0) && (strcmp(g_RebootReason,FACTORY_RESET_REBOOT_REASON)!=0))
{
*rootVersion = strdup("NONE-REBOOT");
WEBCFG_FREE(db_root_string);
return;
}
else if(status == 404 && ((strcmp(db_root_string, "NONE") == 0) || (strcmp(db_root_string, "NONE-MIGRATION") == 0) || (strcmp(db_root_string, "NONE-REBOOT") == 0)))
if(status == 404 && ((strcmp(db_root_string, "NONE") == 0) || (strcmp(db_root_string, "NONE-MIGRATION") == 0) || (strcmp(db_root_string, "NONE-REBOOT") == 0)))
{
*rootVersion = strdup("POST-NONE");
WEBCFG_FREE(db_root_string);
Expand Down Expand Up @@ -1595,6 +1589,8 @@ void createCurlHeader( struct curl_slist *list, struct curl_slist **header_list,
list = curl_slist_append(list, version_header);
WEBCFG_FREE(version_header);
}
WebcfgInfo("Post none retain header formed POST-NONE-RETAIN: true\n");
list = curl_slist_append(list, "POST-NONE-RETAIN: true");
}
list = curl_slist_append(list, "Accept: application/msgpack");

Expand Down
Loading