@@ -492,7 +492,7 @@ bool CWebCore::UpdateListsFromMaster ()
492492 OutputDebugLine ( " Updating white- and blacklist..." );
493493 #endif
494494 g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString (" %s?type=getrev" , BROWSER_UPDATE_URL),
495- NULL , 0 , NULL , 0 , false , this , &CWebCore::StaticFetchRevisionProgress , false , 3 );
495+ NULL , 0 , NULL , 0 , false , this , &CWebCore::StaticFetchRevisionFinished , false , 3 );
496496
497497 pLastUpdateNode->SetTagContent ( SString ( " %d" , (long long )currentTime ) );
498498 m_pXmlConfig->Write ();
@@ -672,10 +672,10 @@ void CWebCore::GetFilterEntriesByType ( std::vector<std::pair<SString, bool>>& o
672672 }
673673}
674674
675- bool CWebCore::StaticFetchRevisionProgress ( double dDownloadNow, double dDownloadTotal, char * pCompletedData, size_t completedLength, void *pObj, bool bComplete , int iError )
675+ void CWebCore::StaticFetchRevisionFinished ( char * pCompletedData, size_t completedLength, void *pObj, bool bSuccess , int iErrorCode )
676676{
677677 CWebCore* pWebCore = static_cast < CWebCore* > ( pObj );
678- if ( bComplete )
678+ if ( bSuccess )
679679 {
680680 SString strData = pCompletedData;
681681 SString strWhiteRevision, strBlackRevision;
@@ -687,43 +687,41 @@ bool CWebCore::StaticFetchRevisionProgress ( double dDownloadNow, double dDownlo
687687 if ( iWhiteListRevision > pWebCore->m_iWhitelistRevision )
688688 {
689689 g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString (" %s?type=fetchwhite" , BROWSER_UPDATE_URL ),
690- NULL , 0 , NULL , 0 , false , pWebCore, &CWebCore::StaticFetchWhitelistProgress , false , 3 );
690+ NULL , 0 , NULL , 0 , false , pWebCore, &CWebCore::StaticFetchWhitelistFinished , false , 3 );
691691
692692 pWebCore->m_iWhitelistRevision = iWhiteListRevision;
693693 }
694694 int iBlackListRevision = atoi ( strBlackRevision );
695695 if ( iBlackListRevision > pWebCore->m_iBlacklistRevision )
696696 {
697697 g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString (" %s?type=fetchblack" , BROWSER_UPDATE_URL),
698- NULL , 0 , NULL , 0 , false , pWebCore, &CWebCore::StaticFetchBlacklistProgress , false , 3 );
698+ NULL , 0 , NULL , 0 , false , pWebCore, &CWebCore::StaticFetchBlacklistFinished , false , 3 );
699699
700700 pWebCore->m_iBlacklistRevision = iBlackListRevision;
701701 }
702702 }
703703 }
704-
705- return true ;
706704}
707705
708- bool CWebCore::StaticFetchWhitelistProgress ( double dDownloadNow, double dDownloadTotal, char * pCompletedData, size_t completedLength, void *pObj, bool bComplete , int iError )
706+ void CWebCore::StaticFetchWhitelistFinished ( char * pCompletedData, size_t completedLength, void *pObj, bool bSuccess , int iErrorCode )
709707{
710- if ( !bComplete )
711- return false ;
708+ if ( !bSuccess )
709+ return ;
712710
713711 CWebCore* pWebCore = static_cast < CWebCore* > ( pObj );
714712 if ( !pWebCore->m_pXmlConfig )
715- return false ;
713+ return ;
716714
717715 if ( !pWebCore->MakeSureXMLNodesExist () )
718- return false ;
716+ return ;
719717
720718 CXMLNode* pRootNode = pWebCore->m_pXmlConfig ->GetRootNode ();
721719 std::vector<SString> whitelist;
722720 SString strData = pCompletedData;
723721 strData.Split ( " ;" , whitelist );
724722 CXMLNode* pListNode = pRootNode->FindSubNode ( " globalwhitelist" );
725723 if ( !pListNode )
726- return false ;
724+ return ;
727725 pListNode->DeleteAllSubNodes ();
728726
729727 for ( std::vector<SString>::const_iterator iter = whitelist.begin (); iter != whitelist.end (); ++iter )
@@ -735,7 +733,7 @@ bool CWebCore::StaticFetchWhitelistProgress ( double dDownloadNow, double dDownl
735733 // Set whitelist revision
736734 CXMLNode* pNode = pRootNode->FindSubNode ( " whitelistrev" );
737735 if ( !pNode )
738- return false ;
736+ return ;
739737 pNode->SetTagContent ( pWebCore->m_iWhitelistRevision );
740738
741739 // Write changes to the XML file
@@ -746,28 +744,27 @@ bool CWebCore::StaticFetchWhitelistProgress ( double dDownloadNow, double dDownl
746744#ifdef MTA_DEBUG
747745 OutputDebugLine ( " Updated whitelist!" );
748746#endif
749- return true ;
750747}
751748
752- bool CWebCore::StaticFetchBlacklistProgress ( double dDownloadNow, double dDownloadTotal, char * pCompletedData, size_t completedLength, void *pObj, bool bComplete , int iError )
749+ void CWebCore::StaticFetchBlacklistFinished ( char * pCompletedData, size_t completedLength, void *pObj, bool bSuccess , int iErrorCode )
753750{
754- if ( !bComplete )
755- return false ;
751+ if ( !bSuccess )
752+ return ;
756753
757754 CWebCore* pWebCore = static_cast < CWebCore* > ( pObj );
758755 if ( !pWebCore->m_pXmlConfig )
759- return false ;
756+ return ;
760757
761758 if ( !pWebCore->MakeSureXMLNodesExist () )
762- return false ;
759+ return ;
763760
764761 CXMLNode* pRootNode = pWebCore->m_pXmlConfig ->GetRootNode ();
765762 std::vector<SString> blacklist;
766763 SString strData = pCompletedData;
767764 strData.Split ( " ;" , blacklist );
768765 CXMLNode* pListNode = pRootNode->FindSubNode ( " globalblacklist" );
769766 if ( !pListNode )
770- return false ;
767+ return ;
771768 pListNode->DeleteAllSubNodes ();
772769
773770 for ( std::vector<SString>::const_iterator iter = blacklist.begin (); iter != blacklist.end (); ++iter )
@@ -779,7 +776,7 @@ bool CWebCore::StaticFetchBlacklistProgress ( double dDownloadNow, double dDownl
779776 // Set blacklist revision
780777 CXMLNode* pNode = pRootNode->FindSubNode ( " blacklistrev" );
781778 if ( !pNode )
782- return false ;
779+ return ;
783780 pNode->SetTagContent ( pWebCore->m_iBlacklistRevision );
784781
785782 // Write changes to the XML file
@@ -790,7 +787,6 @@ bool CWebCore::StaticFetchBlacklistProgress ( double dDownloadNow, double dDownl
790787#ifdef MTA_DEBUG
791788 OutputDebugLine ( " Updated browser blacklist!" );
792789#endif
793- return true ;
794790}
795791
796792// ////////////////////////////////////////////////////////////
0 commit comments