bool SecondaryBitsFilter::Apply( BitKey & io_bitList, STEP_CODE_DATA_STRUCT & io_sdc ) { #define PRDF_FUNC "[SecondaryBitsFilter::Apply] " bool l_modified = false; do { // This filter should only be applied on the primary passs. if ( !io_sdc.service_data->isPrimaryPass() ) break; // This filter should only be applied if the primary attention type is // CHECK_STOP. if ( CHECK_STOP != io_sdc.service_data->GetAttentionType() ) break; // This filter should only be applied if the the secondary attention // type is RECOVERABLE. if ( RECOVERABLE != io_sdc.service_data->GetCauseAttentionType()) break; //if there is no secondary bit position to flip or if no bit is set in //bit key then let us skip this apply. if( ( 0 == iv_secBitList.size() ) || ( 0 == io_bitList.size()) ) break; BitKey l_key ( iv_secBitList ); io_bitList.removeBits( l_key ); l_modified = true; if( 0 == io_bitList.size() ) { // So, we have no primary bits on. We have one or more secondary bit // on. io_sdc.service_data->setSecondaryErrFlag(); } }while(0); return l_modified; #undef PRDF_FUNC }
DirectoryListing::Directory::~Directory() { if (m_directory_list && m_virus_detect.is_virus_dir()) { CFlyVirusFileList l_file_list; l_file_list.m_virus_path = m_directory_list->getPath(this); l_file_list.m_hub_url = m_directory_list->getHintedUser().hint; l_file_list.m_nick = m_directory_list->getUser()->getLastNick(); l_file_list.m_ip = m_directory_list->getUser()->getIPAsString(); l_file_list.m_time = GET_TIME(); for (auto j = m_files.begin(); j != m_files.end(); ++j) { if (CFlyVirusDetector::is_virus_file((*j)->getName(), (*j)->getSize())) { CFlyTTHKey l_key((*j)->getTTH(), (*j)->getSize()); l_file_list.m_files[l_key].push_back((*j)->getName()); } } CFlyServerJSON::addAntivirusCounter(l_file_list); } for_each(directories.begin(), directories.end(), DeleteFunction()); for_each(m_files.begin(), m_files.end(), DeleteFunction()); }