Skip to content

Commit 961b1d4

Browse files
Merge pull request #7 from shilpa24balaji/webcfg_root
To fix duplicate root issue
2 parents 7efbeca + 7fe17e9 commit 961b1d4

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/webcfg_multipart.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -528,23 +528,22 @@ WEBCFG_STATUS processMsgpackSubdoc(multipart_t *mp, char *transaction_id)
528528
if(success_count ==(int) mp->entries_count-1)
529529
{
530530
char * temp = strdup(g_ETAG);
531-
webconfig_db_data_t * webcfgdb = NULL;
532-
webcfgdb = (webconfig_db_data_t *) malloc (sizeof(webconfig_db_data_t));
533-
534-
webcfgdb->name = strdup("root");
531+
uint32_t version=0;
535532
if(temp)
536533
{
537-
webcfgdb->version = strtoul(temp,NULL,0);
534+
version = strtoul(temp,NULL,0);
538535
WEBCFG_FREE(temp);
539536
}
540-
webcfgdb->next = NULL;
541-
addToDBList(webcfgdb);
542-
success_count++;
537+
if(version != 0)
538+
{
539+
checkDBList("root",version);
540+
success_count++;
541+
}
543542

544-
WebcfgInfo("The Etag is %lu\n",(long)webcfgdb->version );
543+
WebcfgInfo("The Etag is %lu\n",(long)version );
545544
//Delete tmp queue root as all docs are applied
546545
WebcfgInfo("Delete tmp queue root as all docs are applied\n");
547-
WebcfgDebug("root version to delete is %lu\n", (long)webcfgdb->version);
546+
WebcfgDebug("root version to delete is %lu\n", (long)version);
548547
dStatus = deleteFromTmpList("root");
549548
if(dStatus == 0)
550549
{

0 commit comments

Comments
 (0)