From 2005edfdc6f171094ba9f2d24af6e69693ca2d2a Mon Sep 17 00:00:00 2001 From: dcoppa Date: Thu, 29 Jan 2015 14:46:28 +0000 Subject: [PATCH] Merge some fixes from upstream repo: Fix always-true conditional Remove unneeded conversion from CMD4Hash Fix a shadow warning --- net/amule/Makefile | 4 +- .../patch-src_EncryptedStreamSocket_cpp | 19 +++++++++ net/amule/patches/patch-src_MD4Hash_h | 41 +++++++++++++++++++ net/amule/patches/patch-src_amuleDlg_cpp | 37 ++++++++++++++--- net/amule/patches/patch-src_amuleDlg_h | 22 ++++++++++ 5 files changed, 116 insertions(+), 7 deletions(-) create mode 100644 net/amule/patches/patch-src_EncryptedStreamSocket_cpp create mode 100644 net/amule/patches/patch-src_MD4Hash_h create mode 100644 net/amule/patches/patch-src_amuleDlg_h diff --git a/net/amule/Makefile b/net/amule/Makefile index 238708c4edc..a34fae27f5c 100644 --- a/net/amule/Makefile +++ b/net/amule/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.46 2014/03/17 23:22:02 sthen Exp $ +# $OpenBSD: Makefile,v 1.47 2015/01/29 14:46:28 dcoppa Exp $ COMMENT-main = another eDonkey P2P file sharing client COMMENT-web = webserver interface to amuled @@ -6,7 +6,7 @@ COMMENT-daemon =stand-alone daemon/cmdline for amule V = 2.3.1 DISTNAME = aMule-$V -REVISION = 17 +REVISION = 18 CATEGORIES = net HOMEPAGE = http://www.amule.org/ diff --git a/net/amule/patches/patch-src_EncryptedStreamSocket_cpp b/net/amule/patches/patch-src_EncryptedStreamSocket_cpp new file mode 100644 index 00000000000..77a7b5b1963 --- /dev/null +++ b/net/amule/patches/patch-src_EncryptedStreamSocket_cpp @@ -0,0 +1,19 @@ +$OpenBSD: patch-src_EncryptedStreamSocket_cpp,v 1.1 2015/01/29 14:46:28 dcoppa Exp $ + +commit 0aefbcf2f0af62c824c0b203d4147658d361803d +Author: upstream svn +Date: Sat Nov 22 20:53:17 2014 +0000 + +Fix always-true conditional + +--- src/EncryptedStreamSocket.cpp.orig Thu Jan 29 05:13:43 2015 ++++ src/EncryptedStreamSocket.cpp Thu Jan 29 05:14:48 2015 +@@ -142,7 +142,7 @@ CEncryptedStreamSocket::~CEncryptedStreamSocket() + void CEncryptedStreamSocket::SetConnectionEncryption(bool bEnabled, const uint8_t* pTargetClientHash, bool bServerConnection) + { + if (m_StreamCryptState != ECS_UNKNOWN && m_StreamCryptState != ECS_NONE) { +- if (!m_StreamCryptState == ECS_NONE || bEnabled) { ++ if (bEnabled) { + wxFAIL; + } + return; diff --git a/net/amule/patches/patch-src_MD4Hash_h b/net/amule/patches/patch-src_MD4Hash_h new file mode 100644 index 00000000000..dbee4848e50 --- /dev/null +++ b/net/amule/patches/patch-src_MD4Hash_h @@ -0,0 +1,41 @@ +$OpenBSD: patch-src_MD4Hash_h,v 1.1 2015/01/29 14:46:28 dcoppa Exp $ + +commit 752e3e1e57c0f659a67d1818fe458992395ce172 +Author: upstream svn +Date: Sun Jan 25 18:11:43 2015 +0000 + +Remove unneeded conversion from CMD4Hash + +Casting a CUInt128 to a CMD4Hash is evil, although they have the same +size. They're completely unrelated and have to be handled differently. + +--- src/MD4Hash.h.orig Thu Jan 29 05:31:02 2015 ++++ src/MD4Hash.h Thu Jan 29 05:32:57 2015 +@@ -28,8 +28,6 @@ + + #include "ArchSpecific.h" // Needed for Raw{Peek,Poke}UInt64() + +-#include "kademlia/utils/UInt128.h" // Needed for CUInt128 +- + #include // Needed for MULE_VALIDATE_PARAMS + + #ifdef USE_WX_EXTENSIONS +@@ -64,18 +62,6 @@ class CMD4Hash (public) + Clear(); + } + +- /** +- * Create a CMD4Hash from a CUInt128 +- * +- * @param hash The 128 bits integer to be used. +- * +- */ +- CMD4Hash(const Kademlia::CUInt128& hash) { +- byte transitional_array[MD4HASH_LENGTH]; +- hash.ToByteArray(transitional_array); +- SetHash(transitional_array); +- } +- + ~CMD4Hash() { + } + diff --git a/net/amule/patches/patch-src_amuleDlg_cpp b/net/amule/patches/patch-src_amuleDlg_cpp index 26d6513f661..0aa04909eaa 100644 --- a/net/amule/patches/patch-src_amuleDlg_cpp +++ b/net/amule/patches/patch-src_amuleDlg_cpp @@ -1,4 +1,14 @@ -$OpenBSD: patch-src_amuleDlg_cpp,v 1.3 2014/01/13 15:01:22 dcoppa Exp $ +$OpenBSD: patch-src_amuleDlg_cpp,v 1.4 2015/01/29 14:46:28 dcoppa Exp $ + +commit eadb1a0fc4597d919aca00c7b32d8dc6f63a4ae2 +Author: upstream svn +Date: Sun Jan 18 09:44:36 2015 +0000 + +Fix a shadow warning + +No need to declare variables that are only used once in a single function +as class member variables. + Fix the blasted DoNetworkRearrange() upstream git commits: @@ -7,9 +17,26 @@ upstream git commits: http://repo.or.cz/w/amule.git/commit/85ea02a3abc784f415adadfb384c654057e13c01 http://repo.or.cz/w/amule.git/commit/d41b28c86b2f07439928720971896dde1ae89bb1 ---- src/amuleDlg.cpp.orig Sun Oct 9 02:19:08 2011 -+++ src/amuleDlg.cpp Mon Jan 13 14:07:43 2014 -@@ -1433,17 +1433,13 @@ void CamuleDlg::DoNetworkRearrange() +--- src/amuleDlg.cpp.orig Sat Oct 8 19:19:08 2011 ++++ src/amuleDlg.cpp Thu Jan 29 05:25:28 2015 +@@ -1241,6 +1241,7 @@ bool CamuleDlg::Check_and_Init_Skin() + + wxFFileInputStream in(m_skinFileName.GetFullPath()); + wxZipInputStream zip(in); ++ wxZipEntry *entry; + + while ((entry = zip.GetNextEntry()) != NULL) { + wxZipEntry*& current = cat[entry->GetInternalName()]; +@@ -1262,7 +1263,7 @@ void CamuleDlg::Add_Skin_Icon( + wxFFileInputStream in(m_skinFileName.GetFullPath()); + wxZipInputStream zip(in); + +- it = cat.find(wxZipEntry::GetInternalName(iconName + wxT(".png"))); ++ ZipCatalog::iterator it = cat.find(wxZipEntry::GetInternalName(iconName + wxT(".png"))); + if ( it != cat.end() ) { + zip.OpenEntry(*it->second); + if ( !new_image.LoadFile(zip,wxBITMAP_TYPE_PNG) ) { +@@ -1433,17 +1434,13 @@ void CamuleDlg::DoNetworkRearrange() wxToolBarToolBase* toolbarTool = m_wndToolbar->RemoveTool(ID_BUTTONNETWORKS); @@ -28,7 +55,7 @@ upstream git commits: if (thePrefs::GetNetworkED2K()) { #ifndef CLIENT_GUI logs_notebook->AddPage(m_logpages[1].page, m_logpages[1].name); -@@ -1451,57 +1447,88 @@ void CamuleDlg::DoNetworkRearrange() +@@ -1451,57 +1448,88 @@ void CamuleDlg::DoNetworkRearrange() logs_notebook->AddPage(m_logpages[2].page, m_logpages[2].name); } diff --git a/net/amule/patches/patch-src_amuleDlg_h b/net/amule/patches/patch-src_amuleDlg_h new file mode 100644 index 00000000000..b822276d31b --- /dev/null +++ b/net/amule/patches/patch-src_amuleDlg_h @@ -0,0 +1,22 @@ +$OpenBSD: patch-src_amuleDlg_h,v 1.1 2015/01/29 14:46:28 dcoppa Exp $ + +commit eadb1a0fc4597d919aca00c7b32d8dc6f63a4ae2 +Author: upstream svn +Date: Sun Jan 18 09:44:36 2015 +0000 + +Fix a shadow warning + +No need to declare variables that are only used once in a single function +as class member variables. + +--- src/amuleDlg.h.orig Mon Jun 13 03:50:25 2011 ++++ src/amuleDlg.h Thu Jan 29 05:22:44 2015 +@@ -230,8 +230,6 @@ class CamuleDlg : public wxFrame (private) + bool m_GeoIPavailable; + + WX_DECLARE_STRING_HASH_MAP(wxZipEntry*, ZipCatalog); +- ZipCatalog::iterator it; +- wxZipEntry *entry; + ZipCatalog cat; + + PageType m_logpages[4];