From 0cb3a5d44efa41858ab33fa59192b22cfcca5e03 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 1 Jul 2015 20:01:57 -0600 Subject: [PATCH] fix ptr_metadata issue --- XmlDoc.cpp | 24 +++++++++++++++--------- XmlDoc.h | 8 ++++---- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/XmlDoc.cpp b/XmlDoc.cpp index 775c9c35..bb93bed3 100644 --- a/XmlDoc.cpp +++ b/XmlDoc.cpp @@ -6399,15 +6399,21 @@ HashTableX *XmlDoc::getClockCandidatesTable ( ) { if ( m_clockCandidatesDataValid ) { // and table is now valid m_clockCandidatesTableValid = true; - // return empty table if ptr is NULL - if (! ptr_clockCandidatesData ) return &m_clockCandidatesTable; + // we no longer have this, replaced by ptr_metadata + return &m_clockCandidatesTable; + // return empty table if ptr is NULL. take this out then. + //if(!ptr_clockCandidatesData ) return &m_clockCandidatesTable; // otherwise, deserialize - m_clockCandidatesTable.deserialize ( ptr_clockCandidatesData , - size_clockCandidatesData, - m_niceness ); + // m_clockCandidatesTable.deserialize(ptr_clockCandidatesData , + // size_clockCandidatesData, + // m_niceness ); // and return that return &m_clockCandidatesTable; } + + // no longer using this since we got ptr_metadata + return &m_clockCandidatesTable; + // otherwise, get our dates Dates *dp = getDates(); if ( ! dp || dp == (Dates *)-1 ) return (HashTableX *)dp; @@ -6417,8 +6423,8 @@ HashTableX *XmlDoc::getClockCandidatesTable ( ) { if ( dp->m_numDatePtrs == 0 ) { m_clockCandidatesTableValid = true; m_clockCandidatesDataValid = true; - ptr_clockCandidatesData = NULL; - size_clockCandidatesData = 0; + // ptr_clockCandidatesData = NULL; + // size_clockCandidatesData = 0; return &m_clockCandidatesTable; } // and set size to 32 buckets to start @@ -6454,8 +6460,8 @@ HashTableX *XmlDoc::getClockCandidatesTable ( ) { // store it in there m_clockCandidatesTable.serialize ( &m_cctbuf ); // point to it - ptr_clockCandidatesData = m_cctbuf.getBufStart(); - size_clockCandidatesData = need; + // ptr_clockCandidatesData = m_cctbuf.getBufStart(); + // size_clockCandidatesData = need; // that is valid now m_clockCandidatesDataValid = true; return &m_clockCandidatesTable; diff --git a/XmlDoc.h b/XmlDoc.h index 893ac899..aee8bf39 100644 --- a/XmlDoc.h +++ b/XmlDoc.h @@ -375,7 +375,8 @@ class XmlDoc { //char *ptr_sectionsReply; // votes read from sectiondb - m_osvt //char *ptr_sectionsVotes; // our local votes - m_nsvt //char *ptr_addressReply; - char *ptr_clockCandidatesData; + //char *ptr_clockCandidatesData; + char *ptr_metadata; // . serialization of the sectiondb and placedb lists // . that way we can store just these and not have to store the content // of the entire page if we do not need to @@ -388,7 +389,6 @@ class XmlDoc { char *ptr_sectiondbData; char *ptr_tagRecData; LinkInfo *ptr_linkInfo2; - char *ptr_metadata; int32_t size_firstUrl; @@ -410,7 +410,8 @@ class XmlDoc { //int32_t size_sectionsReply; //int32_t size_sectionsVotes; //int32_t size_addressReply; - int32_t size_clockCandidatesData; + //int32_t size_clockCandidatesData; + int32_t size_metadata; //int32_t size_sectiondbData; //int32_t size_placedbData; int32_t size_site; @@ -419,7 +420,6 @@ class XmlDoc { int32_t size_sectiondbData; int32_t size_tagRecData; int32_t size_linkInfo2; - int32_t size_metadata; char m_dummyEnd;