Skip to content

Commit

Permalink
* r502 release sp build-18876
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-pimenov committed Aug 23, 2015
1 parent 0b20c91 commit 88c9438
Show file tree
Hide file tree
Showing 41 changed files with 342,116 additions and 256 deletions.
2 changes: 1 addition & 1 deletion FlyFeatures/AutoUpdate.cpp
Expand Up @@ -498,7 +498,7 @@ void AutoUpdate::startUpdateThisThread()
{
const string& l_name = l_files4UpdateInAllUsersSettings[i].m_sName;
// TODO - óáðàòü èìåíà çàøèòûå â êîä!
if (!l_reloadGeoIP && (l_name == "CustomLocations.bmp" || l_name == "CustomLocations.ini" || l_name == "GeoIPCountryWhois.csv" || l_name == "P2PGuard.ini.ini"))
if (!l_reloadGeoIP && (l_name == "CustomLocations.bmp" || l_name == "CustomLocations.ini" || l_name == "GeoIPCountryWhois.csv" || l_name == "P2PGuard.ini" || l_name == "iblocklist-com.ini"))
{
l_reloadGeoIP = true;
}
Expand Down
79 changes: 55 additions & 24 deletions FlyFeatures/flyServer.cpp
Expand Up @@ -654,11 +654,19 @@ bool CFlyServerConfig::SyncAntivirusDB()
// CFlylinkDBManager::getInstance()->set_registry_variable_int64(e_DeleteCounterAntivirusDB,0);
#endif
__int64 l_cur_merge_counter = 0;
uint64_t l_result_size = 0;
int l_new_delete_counter = 0;
for(int i=0;i<2;++i)
{
l_http_downloader.m_get_http_header_item.clear();
l_http_downloader.m_get_http_header_item.push_back("Avdb-Delete-Count");
l_http_downloader.m_get_http_header_item.push_back("Avdb-Version-Count");
l_http_downloader.m_get_http_header_item.push_back("Avdb-Total-Count");
l_http_downloader.m_get_http_header_item.push_back("Avdb-Record-Count");

//TODO - ïîêà íå ïàøåò
// l_http_downloader.m_get_http_header_item.push_back("Content-Length");

l_cur_merge_counter = CFlylinkDBManager::getInstance()->get_registry_variable_int64(e_MergeCounterAntivirusDB);
const string l_url = g_antivirus_db_url +
"/avdb.php?do=load"
Expand All @@ -668,40 +676,46 @@ bool CFlyServerConfig::SyncAntivirusDB()
"&nosort=1"
"&copath=1";
l_binary_data.clear();
auto l_result_size = l_http_downloader.getBinaryDataFromInet(l_url, l_binary_data, g_winet_connect_timeout/2);
l_result_size = l_http_downloader.getBinaryDataFromInet(l_url, l_binary_data, g_winet_connect_timeout / 2);
if(l_result_size == 0)
{
l_log.step("Antivirus DB error download. " + l_url);
const string l_error = "Antivirus DB error download. URL = " + l_url;
l_log.step(l_error);
CFlyServerJSON::pushError(41, l_error);
return false;
}
#if 0
if (l_result_size != Util::toInt64(l_http_downloader.m_get_http_header_item[3]))
{
const string l_error = "Antivirus DB error download. URL = " + l_url + " size = " + Util::toString(l_result_size) + " Content-Length = " + l_http_downloader.m_get_http_header_item[3];
l_log.step(l_error);
CFlyServerJSON::pushError(41, l_error);
return false;
}
#endif
if(!l_http_downloader.m_get_http_header_item[0].empty())
{
const int l_new_delete_counter = Util::toInt(l_http_downloader.m_get_http_header_item[0]);
l_new_delete_counter = Util::toInt(l_http_downloader.m_get_http_header_item[0]);
dcassert(l_new_delete_counter);
const auto l_cur_delete_counter = CFlylinkDBManager::getInstance()->get_registry_variable_int64(e_DeleteCounterAntivirusDB);
if(l_cur_delete_counter != l_new_delete_counter)
if (l_cur_delete_counter != l_new_delete_counter)
{
if(l_time_stamp == 0)
{
CFlylinkDBManager::getInstance()->purge_antivirus_db(l_new_delete_counter,l_start_sync);
break;
}
else
{
l_time_stamp = 0;
CFlylinkDBManager::getInstance()->purge_antivirus_db(l_new_delete_counter,l_time_stamp);
}
CFlylinkDBManager::getInstance()->purge_antivirus_db(l_new_delete_counter, 0, false);
if (l_time_stamp == 0 && l_result_size > 1)
break;
else
l_time_stamp = 0;
l_log.step("Reload antivirus DB Avdb-Delete-Count = " + Util::toString(l_new_delete_counter));
continue;
}
}
if(l_result_size > 1)
{
l_buf = string((char*)l_binary_data.data(), l_result_size);
}
break;
}
if (!l_buf.empty())
if (l_result_size > 1)
{
l_buf = string((char*)l_binary_data.data(), l_result_size);
}
if (!l_buf.empty())
{
const int l_new_merge_counter = Util::toInt(l_http_downloader.m_get_http_header_item[1]);
dcassert(l_new_merge_counter);
Expand All @@ -714,18 +728,35 @@ bool CFlyServerConfig::SyncAntivirusDB()
const auto l_count = CFlylinkDBManager::getInstance()->sync_antivirus_db(l_buf,l_start_sync);
if(l_count)
{
l_log.step("Add new records: " + Util::toString(l_count));
const auto l_record_count_add = Util::toInt64(l_http_downloader.m_get_http_header_item[3]);
dcassert(l_record_count_add == l_count);
l_log.step("Add new records: " + Util::toString(l_count));
}
}
if(l_cur_merge_counter)
// Record-count-check
const auto l_count_record = CFlylinkDBManager::getInstance()->get_antivirus_record_count();
const string l_error_count = " Antivirus DB record count (sqlite) = " + Util::toString(l_count_record);
l_log.step(l_error_count);
const auto l_record_count_remote = Util::toInt64(l_http_downloader.m_get_http_header_item[2]);
dcassert(l_record_count_remote);
if (l_record_count_remote && l_count_record != l_record_count_remote)
{
dcassert(0);
const string l_error = "Antivirus DB record count (remote) = " + Util::toString(l_record_count_remote) + " Force reload all record...";
l_log.step(l_error);
CFlylinkDBManager::getInstance()->purge_antivirus_db(l_new_delete_counter, 0, false);
CFlyServerJSON::pushError(41, l_error_count + ' ' + l_error);
}
if (l_cur_merge_counter)
{
// TODO Äîáàâèëîñü N-çàïèñåé ê áàçå - ïåðåãðóçèòü èõ â êýø
l_log.step("Antivirus DB version: " + Util::toString(l_cur_merge_counter));
l_log.step("Antivirus DB version: " + Util::toString(l_cur_merge_counter) + " Count virus record:" + Util::toString(l_count_record));
}
#ifdef FLYLINKDC_USE_ANTIVIRUS_DB
if(l_is_change_version)
{
ClientManager::resetAntivirusInfo();
CFlylinkDBManager::getInstance()->load_avdb();
ClientManager::resetAntivirusInfo();
}
#endif
}
Expand Down Expand Up @@ -1159,7 +1190,7 @@ void CFlyServerJSON::pushSyslogError(const string& p_error)
syslog(LOG_USER | LOG_INFO, "%s %s %s [%s]", l_cid.c_str(), l_pid.c_str(), p_error.c_str(), Text::fromT(g_full_user_agent).c_str());
}
//======================================================================================================
bool CFlyServerJSON::pushError(unsigned p_error_code, string p_error) // Last Code = 40 (36 - óñòàðåë)
bool CFlyServerJSON::pushError(unsigned p_error_code, string p_error) // Last Code = 41 (36 - óñòàðåë)
{
bool l_is_send = false;
bool l_is_error = false;
Expand Down
8 changes: 6 additions & 2 deletions FlylinkDC.rc
Expand Up @@ -1085,9 +1085,9 @@ BEGIN
LTEXT "RAW command (default !banip):",IDC_ANTIVIRUS_COMMAND_IP,213,194,104,8
EDITTEXT IDC_ANTIVIRUS_COMMAND_IP_STR,213,205,112,14,ES_AUTOHSCROLL
CONTROL "Antivirus autoban (IP)",IDC_ANTIVIRUS_AUTOBAN_FOR_IP,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,211,182,86,8
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,211,182,116,8
CONTROL "Antivirus autoban (Nick)",IDC_ANTIVIRUS_AUTOBAN_FOR_NICK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,329,182,96,8
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,329,182,132,8
END

IDD_TEXT_STYLES_PAGE DIALOGEX 0, 0, 325, 300
Expand Down Expand Up @@ -2967,6 +2967,10 @@ IDR_ICON_QUESTION_ICON ICON "res\\f_question_16.ico"
IDR_ICON_PAUSE_ICON ICON "res\\f_grey_16.ico"
IDR_ICON_MEDICAL_BAG ICON "res\\medical_bag.ico"
IDR_ICON_THERMOMETR_BAG ICON "res\\thermometer2.ico"
IDR_SKULL_ICO ICON "res\\skull.ico"
IDR_SKULL_RED_ICO ICON "res\\skull_red.ico"
IDR_SKULL2_ICO ICON "res\\skull2.ico"
IDR_SKULL2_RED_ICO ICON "res\\skull2_red.ico"
IDR_ICON_FIREWALL ICON "res\\firewall.ico"
IDR_ICON_CLOCK ICON "res\\clock.ico"
IDR_ICON_CAMSHOOT_ICO ICON "res\\Cam.ico"
Expand Down
63 changes: 63 additions & 0 deletions changelog-flylinkdc-r5xx-svn.txt
@@ -1,4 +1,67 @@
------------------------------------------------------------------------
r18876 | ppa | 2015-08-23 11:36:41 +0300 (��, 23 ��� 2015) | 18 lines

Merged revision(s) 18873-18874 from trunk:
* Updating the database ISPs
http://www.assembla.com/spaces/customlocations-greylink
Build on the base 1304, created 2014-11-20 23:54:35 +0300
Total in database:
- ISP - 1407
- ISPs logo - 1416
- Address range - 5998
Archive CustomLocations.7z created by NightOrion


........
* ����� *.ini �������� ��� �������� ������
* ������� ������� ������ � ���������� ��������� ����� ������ ������� �� ����.
* ��������� ���������� ������ ����������������� �������� � https://www.iblocklist.com (������������ � ������� p2pguard)

........

------------------------------------------------------------------------
r18875 | ppa | 2015-08-23 11:32:32 +0300 (��, 23 ��� 2015) | 1 line

# Log
------------------------------------------------------------------------
r18872 | ppa | 2015-08-22 17:07:55 +0300 (��, 22 ��� 2015) | 12 lines

Merged revision(s) 18867-18871 from trunk:
* �������� ������ � tx.exe
........
# ������� ����� �����������
........
* ���� �������� ����� ������ 10- ������ ������ ��� ������
* ���������� �������������� ������ AVDB (���� ����� ������� �� ������� � ������ ���������� - ����������� ����������� ��� ������)
* � ������ ���� �������� ���� �������� � ���� - ������ ������� ���������.
........
# Log
........

------------------------------------------------------------------------
r18869 | ppa | 2015-08-21 15:40:00 +0300 (��, 21 ��� 2015) | 1 line

# Log
------------------------------------------------------------------------
r18866 | ppa | 2015-08-21 14:33:13 +0300 (��, 21 ��� 2015) | 12 lines

Merged revision(s) 18863-18865 from trunk:
# Log
........
* ���������� ���������� � ������ ��������� ��������
https://github.com/pavel-pimenov/flylinkdc-r5xx/issues/25
........
* ������� ������� �������� ���� avdb - �������� ������ ��� ��������
* ���� ���������� �������� ����� ������������ ���������.
* � ���� ������ ������� ����� - �������� ������ �������� (+/-) (������� Skalolaz)

........

------------------------------------------------------------------------
r18863 | ppa | 2015-08-19 09:46:47 +0300 (��, 19 ��� 2015) | 1 line

# Log
------------------------------------------------------------------------
r18862 | ppa | 2015-08-19 08:30:47 +0300 (��, 19 ��� 2015) | 22 lines

Merged revision(s) 18854-18860 from trunk:
Expand Down
2 changes: 1 addition & 1 deletion client/BufferedSocket.cpp
Expand Up @@ -397,7 +397,7 @@ void BufferedSocket::all_myinfo_parser(const string::size_type p_pos_next_separa
}
else
{
dcassert(m_mode == MODE_LINE);
dcassert(m_mode == MODE_LINE || m_mode == MODE_ZPIPE);
#ifdef _DEBUG
for (auto i = l_line_item.cbegin(); i != l_line_item.cend(); ++i)
{
Expand Down

0 comments on commit 88c9438

Please sign in to comment.