Skip to content

Commit

Permalink
* r504 release sp build-20769
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-pimenov committed Jun 2, 2017
1 parent b643c5c commit bfa4d15
Show file tree
Hide file tree
Showing 102 changed files with 673 additions and 358 deletions.
2 changes: 1 addition & 1 deletion FlyFeatures/RSSManager.h
Expand Up @@ -100,7 +100,7 @@ class RSSFeed
RssFormat DetectRSSFormat(void* data, RSSParser parser);
bool ProcessRSS(void* data, RSSParser parser, bool isUtf8);
bool ProcessAtom(void* data, RSSParser parser, bool isUtf8);
time_t convertPubDate(const string& p_str_date); // [+]PPA
time_t convertPubDate(const string& p_str_date);

FastCriticalSection csNews;
RSSItemList m_newsList;
Expand Down
48 changes: 31 additions & 17 deletions FlyFeatures/flyServer.cpp
Expand Up @@ -1001,13 +1001,16 @@ bool CFlyServerConfig::torrentSearch(HWND p_wnd, int p_message, const ::tstring
unsigned l_page_limit_global = l_root["page_limit"].asUInt();
const Json::Value& l_arrays = l_root["items"];
const Json::Value::ArrayIndex l_count = l_arrays.size();
for (Json::Value::ArrayIndex j = 0; j < l_count; ++j)
for (Json::Value::ArrayIndex k = 0; k < l_count; ++k)
{
const Json::Value& l_cur_item_in = l_arrays[j];
const Json::Value& l_cur_item_in = l_arrays[k];
const auto l_root_torrent_url = l_cur_item_in["url"].asString();
l_log.log("Search = " + l_root_torrent_url);
string l_local_agent = l_cur_item_in["agent"].asString();
string l_tracker_name = l_cur_item_in["name"].asString();
unsigned l_page_limit_local = l_cur_item_in["page_limit"].asUInt();
dcassert(!l_cur_item_in["index"].asString().empty());
int l_index = l_cur_item_in["index"].asInt();
if (l_page_limit_local == 0)
l_page_limit_local = l_page_limit_global;
if (l_local_agent.empty())
Expand All @@ -1017,9 +1020,9 @@ bool CFlyServerConfig::torrentSearch(HWND p_wnd, int p_message, const ::tstring
for (int l_num_page = 0; l_num_page < l_page_limit_local
; ++l_num_page)
{
const string l_search_result = l_lua_state["get_url"](j, l_search_encode.c_str(), "", l_num_page, 0, 0, 0);
const string l_search_url= l_lua_state["get_url"](l_index, l_search_encode.c_str(), "", l_num_page, 0, 0, 0);
#ifdef _DEBUG
LogManager::message("l_url = [page = " + Util::toString(l_num_page) + "] " + l_search_result + " l_agent = " + l_agent + " l_agent_global = " + l_agent);
//LogManager::message("l_url = [page = " + Util::toString(l_num_page) + "] " + l_search_result + " l_agent = " + l_agent + " l_agent_global = " + l_agent);
#endif
try
{
Expand All @@ -1030,15 +1033,15 @@ bool CFlyServerConfig::torrentSearch(HWND p_wnd, int p_message, const ::tstring
{
l_http_downloader.m_user_agent = Text::toT(l_local_agent);
}
if (l_http_downloader.getBinaryDataFromInet(l_search_result, l_data, 1000))
if (l_http_downloader.getBinaryDataFromInet(l_search_url, l_data, 1000))
{
const std::string l_html_result((char*)l_data.data(), l_data.size());
const std::string l_magnet_result = l_lua_state["search"](int(j), l_html_result.c_str());
const std::string l_magnet_result = l_lua_state["search"](l_index, l_html_result.c_str());
if (l_magnet_result.empty())
break; // êîí÷èëèñü ñòðàíè÷êè

#ifdef _DEBUG
//LogManager::message("l_magnet_result = " + l_magnet_result);
LogManager::message("l_magnet_result = " + l_magnet_result);
#endif
try
{
Expand All @@ -1047,8 +1050,12 @@ bool CFlyServerConfig::torrentSearch(HWND p_wnd, int p_message, const ::tstring
const bool l_parsingSuccessful = l_reader.parse(l_magnet_result, l_root);
if (!l_parsingSuccessful)
{
#ifdef _DEBUG
LogManager::message("Error - l_magnet_result = " + l_magnet_result);
#endif
dcassert(0);
const string l_error = "onTorrentSearch[0] async - Failed to parse json l_magnet_result = " + l_magnet_result;
const string l_error = "onTorrentSearch[0] async - Failed to parse json URL = " + l_search_url
+ " l_magnet_result = " + l_magnet_result;
CFlyServerJSON::pushError(78, l_error);
}
else
Expand All @@ -1067,16 +1074,20 @@ bool CFlyServerConfig::torrentSearch(HWND p_wnd, int p_message, const ::tstring
l_result->m_seed = atoi(l_arrays[i]["seed"].asString().c_str());
l_result->m_comment = atoi(l_arrays[i]["comment"].asString().c_str());
l_result->m_url = l_root_torrent_url + l_arrays[i]["url"].asString();
l_result->m_tracker = l_tracker_name;
l_result->m_tracker_index = l_index;
l_result->m_date = l_arrays[i]["date"].asString();
l_result->m_torrent_page = l_num_page+1;
const auto l_size = Text::toLower(l_arrays[i]["size"].asString());
l_result->m_size = atoi(l_size.c_str());
const string l_size = Text::toLower(l_arrays[i]["size"].asString());
dcassert(!l_size.empty());
auto l_size_float = Util::toDouble(l_size);
if (l_size.find("mb") != string::npos)
l_result->m_size = l_result->m_size * 1024 * 1024;
l_size_float = l_size_float * 1024.0 * 1024.0;
if (l_size.find("gb") != string::npos)
l_result->m_size = l_result->m_size * 1024 * 1024 * 1024;
l_size_float = l_size_float * 1024.0 * 1024.0 * 1024.0;
if (l_size.find("kb") != string::npos)
l_result->m_size = l_result->m_size * 1024;
l_size_float = l_size_float * 1024.0;
l_result->m_size = l_size_float;
safe_post_message(p_wnd, p_message, l_result);
}
}
Expand All @@ -1085,30 +1096,30 @@ bool CFlyServerConfig::torrentSearch(HWND p_wnd, int p_message, const ::tstring
catch (const Exception &e)
{
dcassert(0);
const string l_error = "onTorrentSearch[1] async - error " + e.getError();
const string l_error = "onTorrentSearch[1] URL = " + l_search_url +" error " + e.getError();
CFlyServerJSON::pushError(77, l_error);
break;
}
}
else
{
dcassert(0);
const string l_error = "onTorrentSearch[4] getBinaryDataFromInet error l_search_result = " + l_search_result;
const string l_error = "onTorrentSearch[4] getBinaryDataFromInet error l_search_url = " + l_search_url;
CFlyServerJSON::pushError(79, l_error);
break;
}
}
catch (const Exception &e)
{
dcassert(0);
const string l_error = "onTorrentSearch[2] async - Exception " + e.getError();
const string l_error = "onTorrentSearch[2] URL = " + l_search_url + " Exception " + e.getError();
CFlyServerJSON::pushError(77, l_error);
break;
}
catch (std::runtime_error& e)
{
dcassert(0);
CFlyServerJSON::pushError(77, "onTorrentSearch[3] async - runtime_error = " + string(e.what()));
CFlyServerJSON::pushError(77, "onTorrentSearch[3] URL = " + l_search_url + " runtime_error = " + string(e.what()));
break;
}
} // for
Expand Down Expand Up @@ -1140,6 +1151,7 @@ void CFlyServerConfig::loadTorrentSearchEngine()
#else
Util::getDataFromInetSafe(true, "http://etc.fly-server.ru/etc/flylinkdc-search-engine.lua", g_lua_source_search_engine, 1000);
#endif
dcassert(!g_lua_source_search_engine.empty());
}
}
catch (const Exception &e)
Expand Down Expand Up @@ -1843,13 +1855,15 @@ bool CFlyServerJSON::pushStatistic(const bool p_is_sync_run)
{
l_info["ISP_URL"] = l_ISP_URL;
}
#ifdef FLYLINKDC_USE_LOCATION_DIALOG
if (!SETTING(FLY_LOCATOR_COUNTRY).empty())
{
Json::Value& l_locator = l_info["Locator"];
l_locator["Country"] = SETTING(FLY_LOCATOR_COUNTRY);
l_locator["City"] = SETTING(FLY_LOCATOR_CITY);
l_locator["ISP"] = SETTING(FLY_LOCATOR_ISP);
}
#endif
// Àãðåãàöèîííûå ïàðàìåòðû
{
Json::Value& l_stat_info = l_info["Stat"];
Expand Down
2 changes: 2 additions & 0 deletions FlylinkDC.rc
Expand Up @@ -3100,6 +3100,8 @@ IDR_TRANSFER_TREE PNG "res\\TransferTree.png"

IDR_STATE_USERS PNG "res\\StateUsers.png"

IDR_TRACKER_IMAGES PNG "res\\Trackers.png"

IDR_GENDER_USERS PNG "res\\Gender.png"

IDR_FLAGS PNG "res\\Flags.png"
Expand Down
11 changes: 11 additions & 0 deletions MediaInfoLib/History_DLL.txt
Expand Up @@ -7,6 +7,17 @@ x Correction
bug reports and feature request are here:
https://sourceforge.net/p/mediainfo/_list/tickets

Version 0.7.96, 2017-06-01
--------------
+ MPEG-4: display of recorded date from DV substream
x I505, AC-3: crash with some potentially malformed frames
x I477, AVC: fix hang when open .mpls from some 3D BD
x MPEG-4: does not show "1904" year is raw value is 0 (Mac/Linux)
x Dedicated read thread disabled by default (rare dead locks)
x #B1027, MPEG-TS: some files where detected as MPEG-TS or BDAV but they aren't
x Sequence of files : frame count was wrong with sequence of MPEG-TS files (was count of files)
x MXF: detection of more 608/708 with parsing of few frames in the middle of the file was broken

Version 0.7.95, 2017-05-04
--------------
+ EBUCore: EBUCore 1.8 with acquisition metadata output.
Expand Down
2 changes: 1 addition & 1 deletion MediaInfoLib/Source/MediaInfo/MediaInfo_Config.cpp
Expand Up @@ -131,7 +131,7 @@ namespace MediaInfoLib
{

//---------------------------------------------------------------------------
const Char* MediaInfo_Version=__T("MediaInfoLib - v0.7.95");
const Char* MediaInfo_Version=__T("MediaInfoLib - v0.7.96");
const Char* MediaInfo_Url=__T("http://MediaArea.net/MediaInfo");
Ztring EmptyZtring; //Use it when we can't return a reference to a true Ztring
const Ztring EmptyZtring_Const; //Use it when we can't return a reference to a true Ztring, const version
Expand Down
3 changes: 3 additions & 0 deletions MediaInfoLib/Source/MediaInfo/Multiple/File_Mpeg4.cpp
Expand Up @@ -911,6 +911,9 @@ void File_Mpeg4::Streams_Finish()
Ztring Title=Temp->second.Parsers[0]->Retrieve(Stream_General, 0, General_Title);
if (!Title.empty() && Retrieve(Stream_General, 0, General_Title).empty())
Fill(Stream_General, 0, General_Title, Title);
Ztring Recorded_Date=Temp->second.Parsers[0]->Retrieve(Stream_General, 0, General_Recorded_Date);
if (!Recorded_Date.empty() && Retrieve(Stream_General, 0, General_Recorded_Date).empty())
Fill(Stream_General, 0, General_Recorded_Date, Recorded_Date); //TODO: something more generic (which General field from substream should be used for the
}

//Hacks - After
Expand Down
Expand Up @@ -1284,13 +1284,15 @@ void File_Mpeg4::Data_Parse()
{ \
int32u Temp; \
Get_B4(Temp, _NAME); \
_INFO.Date_From_Seconds_1904(Temp); \
if (Temp) \
_INFO.Date_From_Seconds_1904(Temp); \
} \
else \
{ \
int64u Temp; \
Get_B8(Temp, _NAME); \
_INFO.Date_From_Seconds_1904(Temp); \
if (Temp) \
_INFO.Date_From_Seconds_1904(Temp); \
} \
Param_Info1(_INFO); \
} \
Expand Down
4 changes: 2 additions & 2 deletions client/BufferedSocket.cpp
Expand Up @@ -656,8 +656,8 @@ void BufferedSocket::threadRead()
}
}
// process all lines
#define USE_FLYLINKDC_MYINFO_ARRAY
#ifdef USE_FLYLINKDC_MYINFO_ARRAY
#define FLYLINKDC_USE_MYINFO_ARRAY
#ifdef FLYLINKDC_USE_MYINFO_ARRAY
#ifdef _DEBUG
// LogManager::message("BufferedSocket::threadRead[MODE_ZPIPE] = " + l);
#endif
Expand Down
4 changes: 1 addition & 3 deletions client/CFlyProfiler.h
Expand Up @@ -4,7 +4,7 @@
#ifndef __CFLYPROFILER_H__
#define __CFLYPROFILER_H__

#if !defined(_WIN64) // [+]PPA
#if !defined(_WIN64)

#ifdef _DEBUG
// #define __PROFILER_ENABLED__
Expand Down Expand Up @@ -63,7 +63,6 @@
#define PROFILE_STOP() Profiler::exit();
#else

// [+]PPA TODO fix copy-paste
#define PROFILE_THREAD_START_RAW( text )
#define PROFILE_THREAD_START()
#define PROFILE_THREAD_START_DESC( desc )
Expand Down Expand Up @@ -316,7 +315,6 @@ struct ScopedTimer
};

#else
// [+]PPA TODO fix copy-paste

#define PROFILE_THREAD_START_RAW( text )
#define PROFILE_THREAD_START()
Expand Down
2 changes: 1 addition & 1 deletion client/CFlylinkDBManager.cpp
Expand Up @@ -2727,7 +2727,7 @@ int32_t CFlylinkDBManager::load_queue()
l_added, l_tthRoot, max((uint8_t)1, l_maxSegments));

dcassert(qi->isDirtyAll() == false);
qi->setDirty(false); // [+]PPA çàãðóçèëè èç î÷åðåäè - ñäåëàåì åå ÷èñòóþ
qi->setDirty(false);
l_qitem.push_back(qi);
}
// [+] brain-ripper
Expand Down
2 changes: 1 addition & 1 deletion client/ClientManager.h
Expand Up @@ -37,7 +37,7 @@ class ClientManager : public Speaker<ClientManagerListener>,
public:
Client* getClient(const string& aHubURL, bool p_is_auto_connect);
void putClient(Client* p_client);
void prepareClose(); // [+]PPA
void prepareClose();
static StringList getHubs(const CID& cid, const string& hintUrl);
static StringList getHubNames(const CID& cid, const string& hintUrl);
static StringList getNicks(const CID& cid, const string& hintUrl);
Expand Down
10 changes: 5 additions & 5 deletions client/DCPlusPlus.cpp
Expand Up @@ -44,7 +44,7 @@
#include "IPGrant.h"
#endif // SSA_IPGRANT_FEATURE

#ifdef USE_FLYLINKDC_VLD
#ifdef FLYLINKDC_USE_VLD
#include "C:\Program Files (x86)\Visual Leak Detector\include\vld.h" // VLD êà÷àòü òóò http://vld.codeplex.com/
#endif

Expand Down Expand Up @@ -132,12 +132,12 @@ void startup(PROGRESSCALLBACKPROC pProgressCallbackProc, void* pProgressParam, G
LOAD_STEP("TTH on GPU", GPGPUTTHManager::newInstance());
#endif
HashManager::newInstance();
#ifdef USE_FLYLINKDC_VLD
#ifdef FLYLINKDC_USE_VLD
VLDDisable(); // TODO VLD ïîêàçûâàåò òàì ëèêè - íå ïîíÿë ïîêà êàê ïîáåäèòü OpenSSL
#endif
// FLYLINKDC_CRYPTO_DISABLE
LOAD_STEP("SSL", CryptoManager::newInstance());
#ifdef USE_FLYLINKDC_VLD
#ifdef FLYLINKDC_USE_VLD
VLDEnable(); // TODO VLD ïîêàçûâàåò òàì ëèêè - íå ïîíÿë ïîêà êàê ïîáåäèòü OpenSSL
#endif
SearchManager::newInstance();
Expand Down Expand Up @@ -308,12 +308,12 @@ void shutdown(GUIINITPROC pGuiInitProc, void *pGuiParam)
ADLSearchManager::deleteInstance();
FinishedManager::deleteInstance();
ShareManager::deleteInstance();
#ifdef USE_FLYLINKDC_VLD
#ifdef FLYLINKDC_USE_VLD
VLDDisable(); // TODO VLD ïîêàçûâàåò òàì ëèêè - íå ïîíÿë ïîêà êàê ïîáåäèòü OpenSSL
#endif
// FLYLINKDC_CRYPTO_DISABLE
CryptoManager::deleteInstance();
#ifdef USE_FLYLINKDC_VLD
#ifdef FLYLINKDC_USE_VLD
VLDEnable(); // TODO VLD ïîêàçûâàåò òàì ëèêè - íå ïîíÿë ïîêà êàê ïîáåäèòü OpenSSL
#endif
ThrottleManager::deleteInstance();
Expand Down
2 changes: 1 addition & 1 deletion client/DirectoryListing.cpp
Expand Up @@ -493,7 +493,7 @@ void ListLoader::startTag(const string& name, StringPairList& attribs, bool simp
{
m_base = b;
}
if (m_base.size() > 1) // [+]PPA fix for [4](("Version", "1"),("CID", "EDI7OWB6TZWH6X6L2D3INC6ORQSG6RQDJ6AJ5QY"),("Base", "/"),("Generator", "DC++ 0.785"))
if (m_base.size() > 1)
{
const StringTokenizer<string> sl(m_base.substr(1), '/');
for (auto i = sl.getTokens().cbegin(); i != sl.getTokens().cend(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion client/DownloadManager.cpp
Expand Up @@ -1205,7 +1205,7 @@ bool DownloadManager::pause_torrent_file(const libtorrent::sha1_hash& p_sha1, bo
}
}
return false;

}
bool DownloadManager::remove_torrent_file(const libtorrent::sha1_hash& p_sha1, const int p_delete_options)
{
Expand Down

0 comments on commit bfa4d15

Please sign in to comment.