openbsd-ports/net/amule/patches/patch-src_SearchList_h
dcoppa 3a0b753bad Merge two fixes from upstream git repository.
git commit a19567efa969835503823d6f6d193dcc83eb92ef:

Try to find best possible keyword for Kad search.
For example most user will search like this "The oxymoronaccelerator
2", which would ask the node which indexes "the". This causes higher
traffic for such nodes and makes them a viable target to attackers,
while the kad result should be the same or even better if we ask
the node which indexes the rare keyword "oxymoronaccelerator", so
we try to rearrange keywords and generally assume that the longer
keywords are rarer.

git commit 5cf7ef9a7dcff2776d9ebc8bb8337e7e3203e6ab:

Add a routine to set file name conversion for amuled, which is based
on wxAppConsole: fix sharing directories with non-ASCII names with
aMule daemon.
2016-11-23 09:56:21 +00:00

46 lines
2.0 KiB
Plaintext

$OpenBSD: patch-src_SearchList_h,v 1.1 2016/11/23 09:56:21 dcoppa Exp $
commit a19567efa969835503823d6f6d193dcc83eb92ef
Author: upstream svn <svn@amule.org>
Date: Mon Nov 21 10:58:27 2016 +0000
Try to find best possible keyword for Kad search
For example most user will search like this "The oxymoronaccelerator
2", which would ask the node which indexes "the". This causes higher
traffic for such nodes and makes them a viable target to attackers,
while the kad result should be the same or even better if we ask
the node which indexes the rare keyword "oxymoronaccelerator", so
we try to rearrange keywords and generally assume that the longer
keywords are rarer.
--- src/SearchList.h.orig Fri Sep 16 09:55:06 2016
+++ src/SearchList.h Tue Nov 22 20:17:39 2016
@@ -64,6 +64,8 @@ class CSearchList : public wxEvtHandler (public)
//! The actual string to search for.
wxString searchString;
+ //! The keyword selected for Kad search
+ wxString strKeyword;
//! The type of files to search for (may be empty), one of ED2KFTSTR_*
wxString typeText;
//! The filename extension. May be empty.
@@ -90,7 +92,7 @@ class CSearchList : public wxEvtHandler (public)
* @param params The search parameters, see CSearchParams.
* @return An empty string on success, otherwise an error-message.
*/
- wxString StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params);
+ wxString StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params);
/** Stops the current search (global or Kad), if any is in progress. */
void StopSearch(bool globalOnly = false);
@@ -189,7 +191,7 @@ class CSearchList : public wxEvtHandler (public)
typedef std::auto_ptr<CMemFile> CMemFilePtr;
/** Create a basic search-packet for the given search-type. */
- CMemFilePtr CreateSearchData(const CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
+ CMemFilePtr CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
//! Timer used for global search intervals.