Projects
Extra
aMule
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 36
View file
aMule.spec
Changed
@@ -1,6 +1,6 @@ Name: aMule Summary: Another eMule file-sharing program -Version: 2.3.1+git20160125.1804 +Version: 2.3.1+git20160212.1136 Release: 0 License: GPL-2.0+ Group: Productivity/Networking/Other
View file
update.diff.xz
Changed
@@ -0,0 +1,1028 @@ +diff --git a/docs/Changelog b/docs/Changelog +index 1b53b40..1dedb12 100644 +--- a/docs/Changelog ++++ b/docs/Changelog +@@ -25,6 +25,7 @@ Version 2.4.0 - The river knows. + the locale has been set + * Fix Crypto++ detection routine happily using build library + for host when cross-compiling ++ * Fix bug #1711: Kad Info tab should display my own user ID + + iz0bbz: + * Fix WinSock library version detection with MinGW-w64 +diff --git a/m4/boost.m4 b/m4/boost.m4 +index 928a3d6..9acd270 100644 +--- a/m4/boost.m4 ++++ b/m4/boost.m4 +@@ -585,27 +585,79 @@ LDFLAGS=$boost_filesystem_save_LDFLAGS + # BOOST_CONTEXT([PREFERRED-RT-OPT]) + # ----------------------------------- + # Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the +-# documentation of BOOST_FIND_LIB above. This library was introduced in Boost +-# 1.51.0 ++# documentation of BOOST_FIND_LIB above. ++# ++# * This library was introduced in Boost 1.51.0 ++# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0 ++# * A dependency on boost_thread appears in 1.57.0 + BOOST_DEFUN([Context], +-[BOOST_FIND_LIB([context], [$1], ++[boost_context_save_LIBS=$LIBS ++ boost_context_save_LDFLAGS=$LDFLAGS ++if test $boost_major_version -ge 157; then ++ BOOST_THREAD([$1]) ++ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl ++ LIBS="$LIBS $BOOST_THREAD_LIBS" ++ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS" ++fi ++BOOST_FIND_LIB([context], [$1], + [boost/context/all.hpp],[[ ++ + // creates a stack + void * stack_pointer = new void*[4096]; + std::size_t const size = sizeof(void*[4096]); + +-// context fc uses f() as context function +-// fcontext_t is placed on top of context stack +-// a pointer to fcontext_t is returned ++#if BOOST_VERSION <= 105100 ++ctx::make_fcontext(&fc, f); ++return ctx::jump_fcontext(&fcm, &fc, 3) == 6; ++ ++#else ++ + fc = ctx::make_fcontext(stack_pointer, size, f); +-return ctx::jump_fcontext(&fcm, fc, 3) == 6;]],[dnl ++return ctx::jump_fcontext(&fcm, fc, 3) == 6; ++ ++#endif ++ ++ ++]],[dnl ++ ++#include <boost/version.hpp> ++#if BOOST_VERSION <= 105100 ++ ++namespace ctx = boost::ctx; ++ ++static ctx::fcontext_t fcm, fc; ++ ++static void f(intptr_t i) { ++ ctx::jump_fcontext(&fc, &fcm, i * 2); ++} ++ ++#elif BOOST_VERSION <= 105500 ++ + namespace ctx = boost::context; ++ + // context + static ctx::fcontext_t fcm, *fc; ++ + // context-function + static void f(intptr_t i) { + ctx::jump_fcontext(fc, &fcm, i * 2); +-}]) ++} ++ ++#else ++ ++namespace ctx = boost::context; ++ ++// context ++static ctx::fcontext_t fcm, fc; ++ ++// context-function ++static void f(intptr_t i) { ++ ctx::jump_fcontext(&fc, fcm, i * 2); ++} ++#endif ++]) ++LIBS=$boost_context_save_LIBS ++LDFLAGS=$boost_context_save_LDFLAGS + ])# BOOST_CONTEXT + + +@@ -637,10 +689,21 @@ m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)]) + LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS" + LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS" + +-BOOST_FIND_LIB([coroutine], [$1], +- [boost/coroutine/coroutine.hpp], +- [boost::coroutines::coroutine< int(int) > coro; coro.empty();]) +- ++# in 1.53 coroutine was a header only library ++if test $boost_major_version -eq 153; then ++ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp]) ++else ++ BOOST_FIND_LIB([coroutine], [$1], ++ [boost/coroutine/coroutine.hpp], ++ [ ++ #include <boost/version.hpp> ++ #if BOOST_VERSION <= 105500 ++ boost::coroutines::coroutine<int(int)> coro; coro.get(); ++ #else ++ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get(); ++ #endif ++ ]) ++fi + # Link-time dependency from coroutine to context, existed only in 1.53, in 1.54 + # coroutine doesn't use context from its headers but from its library. + if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then +@@ -752,8 +815,19 @@ BOOST_DEFUN([Geometry], + # Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. + BOOST_DEFUN([Graph], +-[BOOST_FIND_LIB([graph], [$1], ++[boost_graph_save_LIBS=$LIBS ++boost_graph_save_LDFLAGS=$LDFLAGS ++# Link-time dependency from graph to regex was added as of 1.40.0. ++if test $boost_major_version -ge 140; then ++ BOOST_REGEX([$1]) ++ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl ++ LIBS="$LIBS $BOOST_REGEX_LIBS" ++ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS" ++fi ++BOOST_FIND_LIB([graph], [$1], + [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) ++LIBS=$boost_graph_save_LIBS ++LDFLAGS=$boost_graph_save_LDFLAGS + ])# BOOST_GRAPH + + +@@ -786,9 +860,21 @@ BOOST_DEFUN([Lambda], + # -------------- + # Look for Boost.Locale + BOOST_DEFUN([Locale], +-[BOOST_FIND_LIB([locale], [$1], ++[ ++boost_locale_save_LIBS=$LIBS ++boost_locale_save_LDFLAGS=$LDFLAGS ++# require SYSTEM for boost-1.50.0 and up ++if test $boost_major_version -ge 150; then ++ BOOST_SYSTEM([$1]) ++ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl ++ LIBS="$LIBS $BOOST_SYSTEM_LIBS" ++ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" ++fi # end of the Boost.System check. ++BOOST_FIND_LIB([locale], [$1], + [boost/locale.hpp], + [[boost::locale::generator gen; std::locale::global(gen(""));]]) ++LIBS=$boost_locale_save_LIBS ++LDFLAGS=$boost_locale_save_LDFLAGS + ])# BOOST_LOCALE + + # BOOST_LOG([PREFERRED-RT-OPT]) +@@ -796,9 +882,19 @@ BOOST_DEFUN([Locale], + # Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. + BOOST_DEFUN([Log], +-[BOOST_FIND_LIB([log], [$1], ++[boost_log_save_LIBS=$LIBS ++boost_log_save_LDFLAGS=$LDFLAGS ++BOOST_SYSTEM([$1]) ++BOOST_FILESYSTEM([$1]) ++BOOST_DATE_TIME([$1]) ++m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl ++LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" ++LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS" ++BOOST_FIND_LIB([log], [$1], + [boost/log/core/core.hpp], + [boost::log::attribute a; a.get_value();]) ++LIBS=$boost_log_save_LIBS ++LDFLAGS=$boost_log_save_LDFLAGS + ])# BOOST_LOG + + +@@ -807,10 +903,17 @@ BOOST_DEFUN([Log], + # Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the + # documentation of BOOST_FIND_LIB above. + BOOST_DEFUN([Log_Setup], +-[AC_REQUIRE([BOOST_LOG])dnl ++[boost_log_setup_save_LIBS=$LIBS ++boost_log_setup_save_LDFLAGS=$LDFLAGS ++BOOST_LOG([$1]) ++m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl ++LIBS="$LIBS $BOOST_LOG_LIBS" ++LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS" + BOOST_FIND_LIB([log_setup], [$1], + [boost/log/utility/setup/from_settings.hpp], + [boost::log::basic_settings<char> bs; bs.empty();]) ++LIBS=$boost_log_setup_save_LIBS ++LDFLAGS=$boost_log_setup_save_LDFLAGS + ])# BOOST_LOG_SETUP + + +@@ -1306,6 +1409,8 @@ if test x$boost_cv_inc_path != xno; then + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). + for i in \ ++ _BOOST_mingw_test(5, 3) \ ++ _BOOST_gcc_test(5, 3) \ + _BOOST_mingw_test(5, 2) \ + _BOOST_gcc_test(5, 2) \ + _BOOST_mingw_test(5, 1) \ +diff --git a/src/ECSpecialCoreTags.cpp b/src/ECSpecialCoreTags.cpp +index fc378ef..e7bc3d4 100644 +--- a/src/ECSpecialCoreTags.cpp ++++ b/src/ECSpecialCoreTags.cpp +@@ -148,6 +148,10 @@ CEC_ConnState_Tag::CEC_ConnState_Tag(EC_DETAIL_LEVEL detail_level) : CECTag(EC_T + } + + AddTag(CECTag(EC_TAG_CLIENT_ID, theApp->GetID())); ++ ++ if (Kademlia::CKademlia::IsRunning()) { ++ AddTag(CECTag(EC_TAG_KAD_ID, Kademlia::CKademlia::GetKadID())); ++ } + } + + CEC_PartFile_Tag::CEC_PartFile_Tag(const CPartFile *file, EC_DETAIL_LEVEL detail_level, CValueMap *valuemap) +diff --git a/src/ExternalConnector.cpp b/src/ExternalConnector.cpp +index 96b3001..76d22a7 100644 +--- a/src/ExternalConnector.cpp ++++ b/src/ExternalConnector.cpp +@@ -455,8 +455,10 @@ bool CaMuleExternalConnector::OnCmdLineParsed(wxCmdLineParser& parser) + } + + if (!parser.Found(wxT("config-file"), &m_configFileName)) { +- m_configFileName = GetConfigDir() + wxT("remote.conf"); ++ m_configFileName = wxT("remote.conf"); + } ++ m_configDir = GetConfigDir(m_configFileName); ++ m_configFileName = m_configDir + m_configFileName; + + wxString aMuleConfigFile; + if (parser.Found(wxT("create-config-from"), &aMuleConfigFile)) { +@@ -536,8 +538,8 @@ void CaMuleExternalConnector::LoadConfigFile() + + void CaMuleExternalConnector::SaveConfigFile() + { +- if (!wxFileName::DirExists(GetConfigDir())) { +- wxFileName::Mkdir(GetConfigDir()); ++ if (!wxFileName::DirExists(m_configDir)) { ++ wxFileName::Mkdir(m_configDir); + } + if (!m_configFile) { + m_configFile = new CECFileConfig(m_configFileName); +diff --git a/src/ExternalConnector.h b/src/ExternalConnector.h +index 38b731c..4d1c5c3 100644 +--- a/src/ExternalConnector.h ++++ b/src/ExternalConnector.h +@@ -154,14 +154,13 @@ public: + void OnAssertFailure(const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg); + #endif + +- CECFileConfig* m_configFile; +- wxString m_configFileName; +- + protected: + // Set current locale, if language is not empty. + // returns canonical name of set (current) locale + virtual wxString SetLocale(const wxString& language); + ++ CECFileConfig* m_configFile; ++ wxString m_configDir; + long m_port; + wxString m_host; + CMD4Hash m_password; +@@ -177,6 +176,7 @@ protected: + #endif + + private: ++ wxString m_configFileName; + wxString m_cmdargs; + wxString m_lastcmdstr; + CRemoteConnect* m_ECClient; +diff --git a/src/FileDetailDialog.cpp b/src/FileDetailDialog.cpp +index 4c72a65..dd50fdc 100644 +--- a/src/FileDetailDialog.cpp ++++ b/src/FileDetailDialog.cpp +@@ -63,7 +63,6 @@ m_files(files), + m_index(index), + m_filenameChanged(false) + { +- theApp->m_FileDetailDialogActive++; + m_timer.SetOwner(this, ID_MY_TIMER); + m_timer.Start(5000); + wxSizer *content = fileDetails(this, true); +@@ -75,7 +74,6 @@ m_filenameChanged(false) + + CFileDetailDialog::~CFileDetailDialog() + { +- theApp->m_FileDetailDialogActive = 0; + m_timer.Stop(); + } + +diff --git a/src/GuiEvents.cpp b/src/GuiEvents.cpp +index 0ec31c6..5191aa8 100644 +--- a/src/GuiEvents.cpp ++++ b/src/GuiEvents.cpp +@@ -775,22 +775,5 @@ namespace MuleNotify + + #endif // #ifndef CLIENT_GUI + +- void UDPSocketSend(CMuleUDPSocket * NOT_ON_REMOTEGUI(socket)) +- { +-#ifndef CLIENT_GUI +- AddDebugLogLineF(logAsio, wxT("UDPSocketSend")); +- socket->OnSend(0); +-#endif +- } +- +- void UDPSocketReceive(CMuleUDPSocket * NOT_ON_REMOTEGUI(socket)) +- { +-#ifndef CLIENT_GUI +- AddDebugLogLineF(logAsio, wxT("UDPSocketReceive")); +- socket->OnReceive(0); +-#endif +- } +- +- + } + // File_checked_for_headers +diff --git a/src/LibSocketAsio.cpp b/src/LibSocketAsio.cpp +index af06128..29d302d 100644 +--- a/src/LibSocketAsio.cpp ++++ b/src/LibSocketAsio.cpp +@@ -1491,6 +1491,19 @@ namespace MuleNotify + socketServer->OnAccept(); + } + ++ void UDPSocketSend(CMuleUDPSocket * socket) ++ { ++ AddDebugLogLineF(logAsio, wxT("UDPSocketSend")); ++ socket->OnSend(0); ++ } ++ ++ void UDPSocketReceive(CMuleUDPSocket * socket) ++ { ++ AddDebugLogLineF(logAsio, wxT("UDPSocketReceive")); ++ socket->OnReceive(0); ++ } ++ ++ + } // namespace MuleNotify + + // +diff --git a/src/Makefile.am b/src/Makefile.am +index ad90799..934fa4e 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -86,7 +86,8 @@ libmuleappcommon_a_SOURCES = \ + SHA.cpp \ + Tag.cpp \ + TerminationProcess.cpp \ +- Timer.cpp ++ Timer.cpp \ ++ kademlia/utils/UInt128.cpp + + libmuleappcommon_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS) + +@@ -112,8 +113,7 @@ libmuleappcore_a_SOURCES = \ + kademlia/kademlia/Entry.cpp \ + kademlia/kademlia/Indexed.cpp \ + kademlia/kademlia/SearchManager.cpp \ +- kademlia/routing/RoutingBin.cpp \ +- kademlia/utils/UInt128.cpp ++ kademlia/routing/RoutingBin.cpp + + libmuleappcore_a_CPPFLAGS = $(AM_CPPFLAGS) $(WXBASE_CPPFLAGS) -I$(srcdir)/libs -I$(srcdir)/include $(CRYPTOPP_CPPFLAGS) $(LIBUPNP_CPPFLAGS) + +diff --git a/src/OtherFunctions.cpp b/src/OtherFunctions.cpp +index 4668df4..42d23f7 100644 +--- a/src/OtherFunctions.cpp ++++ b/src/OtherFunctions.cpp +@@ -1097,27 +1097,24 @@ void DumpMem_DW(const uint32 *ptr, int count) + + wxString GetConfigDir(const wxString &configFileBase) + { +- // Cache the path. +- static wxString configPath; ++ wxString configPath; + +- if (configPath.IsEmpty()) { +- // "Portable aMule" - Use aMule from an external USB drive +- // Check for ./config/amule.conf (or whatever gets passed as configFile) +- // and use this configuration if found +- const wxString configDir = JoinPaths(wxFileName::GetCwd(), wxT("config")); +- const wxString configFile = JoinPaths(configDir, configFileBase); ++ // "Portable aMule" - Use aMule from an external USB drive ++ // Check for ./config/amule.conf (or whatever gets passed as configFile) ++ // and use this configuration if found ++ const wxString configDir = JoinPaths(wxFileName::GetCwd(), wxT("config")); ++ const wxString configFile = JoinPaths(configDir, configFileBase); + +- if (CPath::DirExists(configDir) && CPath::FileExists(configFile)) { +- AddLogLineN(CFormat(_("Using config dir: %s")) % configDir); ++ if (CPath::DirExists(configDir) && CPath::FileExists(configFile)) { ++ AddLogLineN(CFormat(_("Using config dir: %s")) % configDir); + +- configPath = configDir; +- } else { +- configPath = wxStandardPaths::Get().GetUserDataDir(); +- } +- +- configPath += wxFileName::GetPathSeparator(); ++ configPath = configDir; ++ } else { ++ configPath = wxStandardPaths::Get().GetUserDataDir(); + } + ++ configPath += wxFileName::GetPathSeparator(); ++ + return configPath; + } + +diff --git a/src/OtherFunctions.h b/src/OtherFunctions.h +index a26127c..a603523 100644 +--- a/src/OtherFunctions.h ++++ b/src/OtherFunctions.h +@@ -350,7 +350,7 @@ inline long int make_full_ed2k_version(int a, int b, int c) { + } + + +-wxString GetConfigDir(const wxString &configFile = wxT("amule.conf")); ++wxString GetConfigDir(const wxString &configFile); + + #if !wxCHECK_VERSION(2, 9, 0) + enum { +diff --git a/src/Preferences.cpp b/src/Preferences.cpp +index 5900c0d..a07ce0e 100644 +--- a/src/Preferences.cpp ++++ b/src/Preferences.cpp +@@ -849,7 +849,7 @@ public: + } else { + folder = wxT("webserver"); + } +- wxString dirName(JoinPaths(GetConfigDir(theApp->m_configFile), folder)); ++ wxString dirName(JoinPaths(thePrefs::GetConfigDir(), folder)); + wxString Filename; + wxDir d; + +diff --git a/src/ServerWnd.cpp b/src/ServerWnd.cpp +index d9e4a98..1ee24e7 100644 +--- a/src/ServerWnd.cpp ++++ b/src/ServerWnd.cpp +@@ -34,6 +34,7 @@ + #include "amuleDlg.h" // Needed for CamuleDlg + #include "amule.h" // Needed for theApp + #include "Logger.h" ++#include "kademlia/utils/UInt128.h" + + #include "ClientList.h" + +@@ -206,6 +207,8 @@ void CServerWnd::UpdateKadInfo() + KadInfoList->SetItem(next_row++, 1, (theApp->IsKadRunningInLanMode() ? _("Running in LAN mode") : _("Running"))); + + // Connection data ++ KadInfoList->InsertItem(next_row, _("Kademlia client ID:")); ++ KadInfoList->SetItem(next_row++, 1, theApp->GetKadID().ToHexString()); + KadInfoList->InsertItem(next_row, _("Status:")); + KadInfoList->SetItem(next_row++, 1, theApp->IsConnectedKad() ? _("Connected"): _("Disconnected")); + if (theApp->IsConnectedKad()) { +diff --git a/src/TextClient.cpp b/src/TextClient.cpp +index c8a3f9e..5d11093 100644 +--- a/src/TextClient.cpp ++++ b/src/TextClient.cpp +@@ -1033,8 +1033,6 @@ namespace MuleNotify + { + void HandleNotification(const class CMuleNotiferBase&) {} + void HandleNotificationAlways(const class CMuleNotiferBase&) {} +- void UDPSocketSend(class CMuleUDPSocket *) {} +- void UDPSocketReceive(class CMuleUDPSocket *) {} + } + + // File_checked_for_headers +diff --git a/src/amule-gui.cpp b/src/amule-gui.cpp +index 415bd86..e1cf577 100644 +--- a/src/amule-gui.cpp ++++ b/src/amule-gui.cpp +@@ -99,7 +99,6 @@ IMPLEMENT_APP(CamuleGuiApp) + CamuleGuiBase::CamuleGuiBase() + { + amuledlg = NULL; +- m_FileDetailDialogActive = 0; + } + + +diff --git a/src/amule-remote-gui.cpp b/src/amule-remote-gui.cpp +index f8c174a..1af561a 100644 +--- a/src/amule-remote-gui.cpp ++++ b/src/amule-remote-gui.cpp +@@ -758,6 +758,7 @@ void CServerConnectRem::HandlePacket(const CECPacket *packet) + CServer *server; + m_ID = tag->GetEd2kId(); + theApp->m_clientID = tag->GetClientId(); ++ tag->GetKadID(theApp->m_kadID); + + if (tag->IsConnectedED2K()) { + const CECTag *srvtag = tag->GetTagByName(EC_TAG_SERVER); +diff --git a/src/amule-remote-gui.h b/src/amule-remote-gui.h +index 3f0786a..26bc1e3 100644 +--- a/src/amule-remote-gui.h ++++ b/src/amule-remote-gui.h +@@ -34,7 +34,7 @@ + #include "Statistics.h" + #include "RLE.h" + #include "SearchList.h" // Needed for CSearchFile +- ++#include "kademlia/utils/UInt128.h" // Needed for CUInt128 + + class CED2KFileLink; + class CServer; +@@ -711,6 +711,7 @@ public: + uint32 GetKadIndexedKeywords() const{ return theStats::GetKadIndexedKeywords(); } + uint32 GetKadIndexedNotes() const { return theStats::GetKadIndexedNotes(); } + uint32 GetKadIndexedLoad() const { return theStats::GetKadIndexedLoad(); } ++ const CUInt128& GetKadID() const { return m_kadID; } + // True IP of machine + uint32 GetKadIPAdress() const { return theStats::GetKadIPAdress(); } + // Buddy status +@@ -741,6 +742,8 @@ public: + // This KnownFile collects all currently uploading clients for display in the upload list control + CKnownFile * m_allUploadingKnownFile; + ++ CUInt128 m_kadID; ++ + DECLARE_EVENT_TABLE() + }; + +diff --git a/src/amule.cpp b/src/amule.cpp +index 30c3ab4..397bc74 100644 +--- a/src/amule.cpp ++++ b/src/amule.cpp +@@ -1749,6 +1749,11 @@ uint32 CamuleApp::GetBuddyPort() const + return clientlist->GetBuddyPort(); + } + ++const Kademlia::CUInt128& CamuleApp::GetKadID() const ++{ ++ return Kademlia::CKademlia::GetKadID(); ++} ++ + bool CamuleApp::CanDoCallback(uint32 clientServerIP, uint16 clientServerPort) + { + if (Kademlia::CKademlia::IsConnected()) { +diff --git a/src/amule.h b/src/amule.h +index d56eaeb..64cee8d 100644 +--- a/src/amule.h ++++ b/src/amule.h +@@ -95,10 +95,14 @@ namespace MuleNotify { + class CMuleGUIEvent; + } + +- + using MuleNotify::CMuleGUIEvent; + + ++namespace Kademlia { ++ class CUInt128; ++} ++ ++ + #ifdef AMULE_DAEMON + #define AMULE_APP_BASE wxAppConsole + #define CORE_TIMER_PERIOD 300 +@@ -228,6 +232,8 @@ public: + uint8 GetBuddyStatus() const; + uint32 GetBuddyIP() const; + uint32 GetBuddyPort() const; ++ // Kad ID ++ const Kademlia::CUInt128& GetKadID() const; + + // Check if we should callback this client + bool CanDoCallback(uint32 clientServerIP, uint16 clientServerPort); +@@ -366,7 +372,6 @@ public: + + wxString m_FrameTitle; + CamuleDlg* amuledlg; +- int m_FileDetailDialogActive; + + bool CopyTextToClipboard( wxString strText ); + void ResetTitle(); +diff --git a/src/amuleAppCommon.cpp b/src/amuleAppCommon.cpp +index 5dd9d34..54e7d0e 100644 +--- a/src/amuleAppCommon.cpp ++++ b/src/amuleAppCommon.cpp +@@ -289,7 +289,7 @@ bool CamuleAppCommon::InitCommon(int argc, wxChar ** argv) + } + thePrefs::SetConfigDir(configdir); + } else { +- thePrefs::SetConfigDir(/*OtherFunctions::*/GetConfigDir()); ++ thePrefs::SetConfigDir(/*OtherFunctions::*/GetConfigDir(m_configFile)); + } + + // Backtracing works in MSW. +diff --git a/src/amuleDlg.cpp b/src/amuleDlg.cpp +index 2fac161..3e797d0 100644 +--- a/src/amuleDlg.cpp ++++ b/src/amuleDlg.cpp +@@ -1210,7 +1210,7 @@ bool CamuleDlg::Check_and_Init_Skin() + return false; + } + +- wxString userDir(JoinPaths(GetConfigDir(), wxT("skins")) + wxFileName::GetPathSeparator()); ++ wxString userDir(JoinPaths(thePrefs::GetConfigDir(), wxT("skins")) + wxFileName::GetPathSeparator()); + + wxStandardPathsBase &spb(wxStandardPaths::Get()); + #ifdef __WINDOWS__ +diff --git a/src/kademlia/kademlia/Kademlia.cpp b/src/kademlia/kademlia/Kademlia.cpp +index f08d735..050cbc8 100644 +--- a/src/kademlia/kademlia/Kademlia.cpp ++++ b/src/kademlia/kademlia/Kademlia.cpp +@@ -54,6 +54,8 @@ there client on the eMule forum.. + #pragma warning(disable:4996) + #endif + ++const CUInt128 Kademlia::s_nullUInt128(false); ++ + //////////////////////////////////////// + using namespace Kademlia; + //////////////////////////////////////// +diff --git a/src/kademlia/kademlia/Kademlia.h b/src/kademlia/kademlia/Kademlia.h +index 035fd3a..5f64a20 100644 +--- a/src/kademlia/kademlia/Kademlia.h ++++ b/src/kademlia/kademlia/Kademlia.h +@@ -59,6 +59,8 @@ class CKadClientSearcher; + + typedef std::map<CRoutingZone*, CRoutingZone*> EventMap; + ++extern const CUInt128 s_nullUInt128; ++ + class CKademlia + { + public: +@@ -84,6 +86,8 @@ public: + static uint32_t GetTotalFile() throw() { return instance && instance->m_prefs ? instance->m_prefs->GetTotalFile() : 0; } + static bool GetPublish() throw() { return instance && instance->m_prefs ? instance->m_prefs->GetPublish() : false; } + static uint32_t GetIPAddress() throw() { return instance && instance->m_prefs ? instance->m_prefs->GetIPAddress() : 0; } ++ static const CUInt128& GetKadID() throw() { return instance && instance->m_prefs ? instance->m_prefs->GetKadID() : s_nullUInt128; } ++ + static void Bootstrap(uint32_t ip, uint16_t port) + { + time_t now = time(NULL); +diff --git a/src/libs/ec/abstracts/ECCodes.abstract b/src/libs/ec/abstracts/ECCodes.abstract +index 3f07f7b..37a498d 100644 +--- a/src/libs/ec/abstracts/ECCodes.abstract ++++ b/src/libs/ec/abstracts/ECCodes.abstract +@@ -171,6 +171,7 @@ EC_TAG_CAN_ZLIB 0x000C + EC_TAG_CAN_UTF8_NUMBERS 0x000D + EC_TAG_CAN_NOTIFY 0x000E + EC_TAG_ECID 0x000F ++EC_TAG_KAD_ID 0x0010 + + + EC_TAG_CLIENT_NAME 0x0100 +diff --git a/src/libs/ec/abstracts/ECTagTypes.abstract b/src/libs/ec/abstracts/ECTagTypes.abstract +index 3f70bd5..8950691 100644 +--- a/src/libs/ec/abstracts/ECTagTypes.abstract ++++ b/src/libs/ec/abstracts/ECTagTypes.abstract +@@ -17,4 +17,5 @@ EC_TAGTYPE_STRING 6 + EC_TAGTYPE_DOUBLE 7 + EC_TAGTYPE_IPV4 8 + EC_TAGTYPE_HASH16 9 ++EC_TAGTYPE_UINT128 10 + [/Section] +diff --git a/src/libs/ec/cpp/ECCodes.h b/src/libs/ec/cpp/ECCodes.h +index 7b44ba5..9de696c 100644 +--- a/src/libs/ec/cpp/ECCodes.h ++++ b/src/libs/ec/cpp/ECCodes.h +@@ -141,6 +141,7 @@ enum ECTagNames { + EC_TAG_CAN_UTF8_NUMBERS = 0x000D, + EC_TAG_CAN_NOTIFY = 0x000E, + EC_TAG_ECID = 0x000F, ++ EC_TAG_KAD_ID = 0x0010, + EC_TAG_CLIENT_NAME = 0x0100, + EC_TAG_CLIENT_VERSION = 0x0101, + EC_TAG_CLIENT_MOD = 0x0102, +@@ -577,6 +578,7 @@ wxString GetDebugNameECTagNames(uint16 arg) + case 0x000D: return wxT("EC_TAG_CAN_UTF8_NUMBERS"); + case 0x000E: return wxT("EC_TAG_CAN_NOTIFY"); + case 0x000F: return wxT("EC_TAG_ECID"); ++ case 0x0010: return wxT("EC_TAG_KAD_ID"); + case 0x0100: return wxT("EC_TAG_CLIENT_NAME"); + case 0x0101: return wxT("EC_TAG_CLIENT_VERSION"); + case 0x0102: return wxT("EC_TAG_CLIENT_MOD"); +diff --git a/src/libs/ec/cpp/ECFileConfig.h b/src/libs/ec/cpp/ECFileConfig.h +index 7ba02fb..367a139 100644 +--- a/src/libs/ec/cpp/ECFileConfig.h ++++ b/src/libs/ec/cpp/ECFileConfig.h +@@ -39,7 +39,7 @@ + inline wxString FinalizeFilename(const wxString filename) + { + if (wxStrchr(filename, wxFileName::GetPathSeparator()) == NULL) { +- return GetConfigDir() + filename; ++ return GetConfigDir(filename) + filename; + } + if ((filename.GetChar(0) == '~') && (filename.GetChar(1) == wxFileName::GetPathSeparator())) { + return wxGetHomeDir() + filename.Mid(1); +diff --git a/src/libs/ec/cpp/ECSpecialTags.h b/src/libs/ec/cpp/ECSpecialTags.h +index 6921b2f..e07cf3b 100644 +--- a/src/libs/ec/cpp/ECSpecialTags.h ++++ b/src/libs/ec/cpp/ECSpecialTags.h +@@ -30,7 +30,7 @@ + #include "../../../NetworkFunctions.h" // Needed for IsLowID + #include "../../../ClientCredits.h" // Needed for EIdentState + #include <common/Format.h> // Needed for CFormat +- ++#include "../../../kademlia/utils/UInt128.h" + + #include <map> + +@@ -65,6 +65,7 @@ class CValueMap { + std::map<ec_tagname_t, uint32> m_map_uint32; + std::map<ec_tagname_t, uint64> m_map_uint64; + std::map<ec_tagname_t, CMD4Hash> m_map_md4; ++ std::map<ec_tagname_t, CUInt128> m_map_uint128; + std::map<ec_tagname_t, wxString> m_map_string; + std::map<ec_tagname_t, CECTag> m_map_tag; + +@@ -88,6 +89,7 @@ class CValueMap { + m_map_uint32 = valuemap.m_map_uint32; + m_map_uint64 = valuemap.m_map_uint64; + m_map_md4 = valuemap.m_map_md4; ++ m_map_uint128 = valuemap.m_map_uint128; + m_map_string = valuemap.m_map_string; + m_map_tag = valuemap.m_map_tag; + } +@@ -117,6 +119,11 @@ class CValueMap { + CreateTagT<CMD4Hash>(tagname, value, m_map_md4, parent); + } + ++ void CreateTag(ec_tagname_t tagname, CUInt128 value, CECTag *parent) ++ { ++ CreateTagT<CUInt128>(tagname, value, m_map_uint128, parent); ++ } ++ + void CreateTag(ec_tagname_t tagname, wxString value, CECTag *parent) + { + CreateTagT<wxString>(tagname, value, m_map_string, parent); +@@ -201,6 +208,7 @@ class CEC_ConnState_Tag : public CECTag { + bool IsConnectedKademlia() const { return (GetInt() & 0x04) != 0; } + bool IsKadFirewalled() const { return (GetInt() & 0x08) != 0; } + bool IsKadRunning() const { return (GetInt() & 0x10) != 0; } ++ bool GetKadID(CUInt128& target) const { return AssignIfExist(EC_TAG_KAD_ID, target); } + }; + + class CEC_SharedFile_Tag : public CECTag { +diff --git a/src/libs/ec/cpp/ECTag.cpp b/src/libs/ec/cpp/ECTag.cpp +index cb1c2d7..3b83220 100644 +--- a/src/libs/ec/cpp/ECTag.cpp ++++ b/src/libs/ec/cpp/ECTag.cpp +@@ -1002,6 +1002,13 @@ void CECTag::DebugPrint(int level, bool print_empty) const + s2 = CFormat(wxT("%.1f")) % GetDoubleData(); break; + case EC_TAGTYPE_HASH16: + s2 = GetMD4Data().Encode(); break; ++ case EC_TAGTYPE_UINT128: ++ // Using any non-inline function from UInt128.h would break linkage ++ // of remote apps otherwise not using CUInt128. So just fall through ++ // and display the value as a byte-stream. Since the value is sent ++ // big-endian on the network, the visual result is correct, except ++ // for the intervening spaces... ++ //s2 = GetInt128Data().ToHexString(); break; + case EC_TAGTYPE_CUSTOM: + if (m_dataLen == 0) { + s2 = wxT("empty"); +diff --git a/src/libs/ec/cpp/ECTag.h b/src/libs/ec/cpp/ECTag.h +index 70308f9..5ca4d56 100644 +--- a/src/libs/ec/cpp/ECTag.h ++++ b/src/libs/ec/cpp/ECTag.h +@@ -41,6 +41,11 @@ + /* aMule/libcommon generic includes */ + #include "../../../MD4Hash.h" // Needed for CMD4Hash + ++namespace Kademlia { ++ class CUInt128; ++} ++using Kademlia::CUInt128; ++ + /* EC specific includes */ + #include "ECCodes.h" // Needed for EC types + #include "ECTagTypes.h" // Needed for TagTypes +@@ -108,6 +113,7 @@ class CECTag { + CECTag(ec_tagname_t name, const std::string& data); + CECTag(ec_tagname_t name, const EC_IPv4_t& data); + CECTag(ec_tagname_t name, const CMD4Hash& data); ++ CECTag(ec_tagname_t name, const CUInt128& data); + #ifdef USE_WX_EXTENSIONS + CECTag(ec_tagname_t name, const wxString& data); + CECTag(ec_tagname_t name, const wxChar* data); +@@ -123,6 +129,7 @@ class CECTag { + bool AddTag(const CECTag& tag, CValueMap* valuemap = NULL); + void AddTag(ec_tagname_t name, uint64_t data, CValueMap* valuemap = NULL); + void AddTag(ec_tagname_t name, const CMD4Hash& data, CValueMap* valuemap); ++ void AddTag(ec_tagname_t name, const CUInt128& data, CValueMap* valuemap); + #ifdef USE_WX_EXTENSIONS + void AddTag(ec_tagname_t name, const wxString& data, CValueMap* valuemap = NULL); + #endif +@@ -157,6 +164,7 @@ class CECTag { + + EC_IPv4_t GetIPv4Data() const; + CMD4Hash GetMD4Data() const; ++ CUInt128 GetInt128Data() const; + + void DebugPrint(int level, bool print_empty) const; + void swap(CECTag & t); +@@ -173,6 +181,7 @@ class CECTag { + double AssignIfExist(ec_tagname_t tagname, double *target) const; + float AssignIfExist(ec_tagname_t tagname, float *target) const; + CMD4Hash AssignIfExist(ec_tagname_t tagname, CMD4Hash *target) const; ++ CUInt128 AssignIfExist(ec_tagname_t tagname, CUInt128 *target) const; + std::string AssignIfExist(ec_tagname_t tagname, std::string *target) const; + #ifdef USE_WX_EXTENSIONS + wxString AssignIfExist(ec_tagname_t tagname, wxString *target) const; +@@ -189,6 +198,7 @@ class CECTag { + bool AssignIfExist(ec_tagname_t tagname, double &target) const; + bool AssignIfExist(ec_tagname_t tagname, float &target) const; + bool AssignIfExist(ec_tagname_t tagname, CMD4Hash &target) const; ++ bool AssignIfExist(ec_tagname_t tagname, CUInt128 &target) const; + bool AssignIfExist(ec_tagname_t tagname, std::string &target) const; + #ifdef USE_WX_EXTENSIONS + bool AssignIfExist(ec_tagname_t tagname, wxString &target) const; +diff --git a/src/libs/ec/cpp/ECTagTypes.h b/src/libs/ec/cpp/ECTagTypes.h +index 3414e65..75c3a3d 100644 +--- a/src/libs/ec/cpp/ECTagTypes.h ++++ b/src/libs/ec/cpp/ECTagTypes.h +@@ -37,7 +37,8 @@ enum ECTagTypes { + EC_TAGTYPE_STRING = 6, + EC_TAGTYPE_DOUBLE = 7, + EC_TAGTYPE_IPV4 = 8, +- EC_TAGTYPE_HASH16 = 9 ++ EC_TAGTYPE_HASH16 = 9, ++ EC_TAGTYPE_UINT128 = 10 + }; + + #ifdef DEBUG_EC_IMPLEMENTATION +@@ -55,6 +56,7 @@ wxString GetDebugNameECTagTypes(uint8 arg) + case 7: return wxT("EC_TAGTYPE_DOUBLE"); + case 8: return wxT("EC_TAGTYPE_IPV4"); + case 9: return wxT("EC_TAGTYPE_HASH16"); ++ case 10: return wxT("EC_TAGTYPE_UINT128"); + default: return CFormat(wxT("unknown %d 0x%x")) % arg % arg; + } + } +diff --git a/src/libs/ec/cpp/ECUInt128.cpp b/src/libs/ec/cpp/ECUInt128.cpp +new file mode 100644 +index 0000000..506f30e +--- /dev/null ++++ b/src/libs/ec/cpp/ECUInt128.cpp +@@ -0,0 +1,91 @@ ++// ++// This file is part of the aMule Project. ++// ++// Copyright (c) 2015 aMule Team ( admin@amule.org / http://www.amule.org ) ++// ++// Any parts of this program derived from the xMule, lMule or eMule project, ++// or contributed by third-party developers are copyrighted by their ++// respective authors. ++// ++// This program is free software; you can redistribute it and/or modify ++// it under the terms of the GNU General Public License as published by ++// the Free Software Foundation; either version 2 of the License, or ++// (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License ++// along with this program; if not, write to the Free Software ++// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++// ++ ++ ++// Implementation of these functions cannot be in ECTag.cpp, because here we ++// use non-inline member functions of CUInt128. This way these functions are ++// only needed if we actually use the CUInt128 class, and will not cause ++// linker errors for apps like aMuleCmd, which don't use CUInt128. ++// ++// The other working possibility would be to make all these functions inline ++// members of CECTag, but that would clutter the header too much. ++ ++ ++#include "ECTag.h" ++#include "ECSpecialTags.h" ++#include "../../../kademlia/utils/UInt128.h" ++ ++ ++CECTag::CECTag(ec_tagname_t tagname, const CUInt128& data) ++ : m_tagName(tagname), ++ m_dataType(EC_TAGTYPE_UINT128), ++ m_dataLen(16) ++{ ++ NewData(); ++ data.ToByteArray(reinterpret_cast<uint8_t *>(m_tagData)); ++} ++ ++void CECTag::AddTag(ec_tagname_t name, const CUInt128& data, CValueMap *valuemap) ++{ ++ if (valuemap) { ++ valuemap->CreateTag(name, data, this); ++ } else { ++ AddTag(CECTag(name, data)); ++ } ++} ++ ++CUInt128 CECTag::GetInt128Data() const ++{ ++ if (m_dataType != EC_TAGTYPE_UINT128) { ++ EC_ASSERT(m_dataType == EC_TAGTYPE_UNKNOWN); ++ return CUInt128(false); ++ } ++ ++ EC_ASSERT(m_tagData != NULL); ++ ++ if (m_tagData) { ++ return CUInt128(reinterpret_cast<const uint8_t *>(m_tagData)); ++ } else { ++ return CUInt128(false); ++ } ++} ++ ++CUInt128 CECTag::AssignIfExist(ec_tagname_t tagname, CUInt128 *target) const ++{ ++ if (AssignIfExist(tagname, *target)) { ++ return *target; ++ } else { ++ return CUInt128(false); ++ } ++} ++ ++bool CECTag::AssignIfExist(ec_tagname_t tagname, CUInt128 &target) const ++{ ++ const CECTag *tag = GetTagByName(tagname); ++ if (tag) { ++ target = tag->GetInt128Data(); ++ return true; ++ } ++ return false; ++} +diff --git a/src/libs/ec/cpp/Makefile.am b/src/libs/ec/cpp/Makefile.am +index 219d600..3bc30c6 100644 +--- a/src/libs/ec/cpp/Makefile.am ++++ b/src/libs/ec/cpp/Makefile.am +@@ -14,7 +14,8 @@ libec_a_SOURCES = \ + ECSocket.cpp \ + ECMuleSocket.cpp \ + RemoteConnect.cpp \ +- ECSpecialTags.cpp ++ ECSpecialTags.cpp \ ++ ECUInt128.cpp + + noinst_HEADERS = \ + ECTag.h \ +diff --git a/src/libs/ec/java/ECCodes.java b/src/libs/ec/java/ECCodes.java +index 7851959..ccf41e5 100644 +--- a/src/libs/ec/java/ECCodes.java ++++ b/src/libs/ec/java/ECCodes.java +@@ -129,6 +129,7 @@ public final static short EC_TAG_CAN_ZLIB = 0x000C; + public final static short EC_TAG_CAN_UTF8_NUMBERS = 0x000D; + public final static short EC_TAG_CAN_NOTIFY = 0x000E; + public final static short EC_TAG_ECID = 0x000F; ++public final static short EC_TAG_KAD_ID = 0x0010; + public final static short EC_TAG_CLIENT_NAME = 0x0100; + public final static short EC_TAG_CLIENT_VERSION = 0x0101; + public final static short EC_TAG_CLIENT_MOD = 0x0102; +diff --git a/src/libs/ec/java/ECTagTypes.java b/src/libs/ec/java/ECTagTypes.java +index a0ccba9..eca3b41 100644 +--- a/src/libs/ec/java/ECTagTypes.java ++++ b/src/libs/ec/java/ECTagTypes.java +@@ -36,5 +36,6 @@ public final static byte EC_TAGTYPE_STRING = 6; + public final static byte EC_TAGTYPE_DOUBLE = 7; + public final static byte EC_TAGTYPE_IPV4 = 8; + public final static byte EC_TAGTYPE_HASH16 = 9; ++public final static byte EC_TAGTYPE_UINT128 = 10; + + } +diff --git a/src/webserver/src/WebInterface.cpp b/src/webserver/src/WebInterface.cpp +index ad3c63a..535f224 100644 +--- a/src/webserver/src/WebInterface.cpp ++++ b/src/webserver/src/WebInterface.cpp +@@ -409,9 +409,6 @@ namespace MuleNotify + CMuleGUIEvent evt(ntf.Clone()); + wxPostEvent(wxTheApp, evt); + } +- +- void UDPSocketSend(class CMuleUDPSocket *) {} +- void UDPSocketReceive(class CMuleUDPSocket *) {} + } + + +@@ -518,7 +515,7 @@ bool CamulewebApp::GetTemplateDir(const wxString& templateName, wxString& templa + } + #endif + +- dir = GetConfigDir(wxT("remote.conf")) + wxT("webserver"); ++ dir = m_configDir + wxT("webserver"); + if (CheckDirForTemplate(dir, templateName)) { + templateDir = dir; + m_localTemplate = true; +@@ -851,7 +848,7 @@ wxString CamulewebApp::SetLocale(const wxString& language) + // First look in ~/.aMule/webserver/<template>, but only if a local template was used + wxString dir; + if (m_localTemplate) { +- dir = JoinPaths(JoinPaths(JoinPaths(GetConfigDir(), wxT("webserver")), m_TemplateName), wxT("locale")); ++ dir = JoinPaths(JoinPaths(JoinPaths(m_configDir, wxT("webserver")), m_TemplateName), wxT("locale")); + DebugShow(wxT("looking for message catalogs in ") + dir + wxT("... ")); + } + if (!m_localTemplate || !DirHasMessageCatalog(dir, lang, domain)) {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.