Merge some fixes from upstream repo:

Fix always-true conditional

Remove unneeded conversion from CMD4Hash

Fix a shadow warning
This commit is contained in:
dcoppa 2015-01-29 14:46:28 +00:00
parent 67e07493d2
commit 2005edfdc6
5 changed files with 116 additions and 7 deletions

View File

@ -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/

View File

@ -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 <svn@amule.org>
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;

View File

@ -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 <svn@amule.org>
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 <common/MuleDebug.h> // 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() {
}

View File

@ -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 <svn@amule.org>
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);
}

View File

@ -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 <svn@amule.org>
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];