aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/depends/packages/expat.mk2
-rw-r--r--contrib/depends/toolchain.cmake.in7
-rw-r--r--contrib/epee/include/console_handler.h25
-rw-r--r--contrib/epee/include/misc_language.h10
-rw-r--r--contrib/epee/include/net/abstract_http_client.h1
-rw-r--r--contrib/epee/include/net/http_client.h8
-rw-r--r--contrib/epee/include/rolling_median.h4
-rw-r--r--contrib/epee/src/abstract_http_client.cpp5
8 files changed, 48 insertions, 14 deletions
diff --git a/contrib/depends/packages/expat.mk b/contrib/depends/packages/expat.mk
index ef81636a2..d73a5e307 100644
--- a/contrib/depends/packages/expat.mk
+++ b/contrib/depends/packages/expat.mk
@@ -1,6 +1,6 @@
package=expat
$(package)_version=2.2.4
-$(package)_download_path=https://downloads.sourceforge.net/project/expat/expat/$($(package)_version)
+$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_4
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=03ad85db965f8ab2d27328abcf0bc5571af6ec0a414874b2066ee3fdd372019e
diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in
index 2634423ab..383b88f31 100644
--- a/contrib/depends/toolchain.cmake.in
+++ b/contrib/depends/toolchain.cmake.in
@@ -1,5 +1,6 @@
# Set the system name to one of Android, Darwin, FreeBSD, Linux, or Windows
SET(CMAKE_SYSTEM_NAME @depends@)
+SET(CMAKE_SYSTEM_PROCESSOR @arch@)
SET(CMAKE_BUILD_TYPE @release_type@)
OPTION(STATIC "Link libraries statically" ON)
@@ -55,7 +56,7 @@ SET(Boost_NO_SYSTEM_PATHS ON)
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_STATIC_RUNTIME ON)
-SET(OpenSSL_DIR @prefix@/lib)
+SET(OPENSSL_ROOT_DIR @prefix@)
SET(ARCHITECTURE @arch@)
# for libraries and headers in the target directories
@@ -63,14 +64,14 @@ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
-set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR} CACHE STRING "" FORCE)
-
# specify the cross compiler to be used. Darwin uses clang provided by the SDK.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
SET(CMAKE_C_COMPILER_TARGET x86_64-apple-darwin11)
SET(CMAKE_CXX_COMPILER @prefix@/native/bin/clang++ -stdlib=libc++)
SET(CMAKE_CXX_COMPILER_TARGET x86_64-apple-darwin11)
+ SET(CMAKE_ASM_COMPILER_TARGET x86_64-apple-darwin11)
+ SET(CMAKE_ASM-ATT_COMPILER_TARGET x86_64-apple-darwin11)
SET(_CMAKE_TOOLCHAIN_PREFIX x86_64-apple-darwin11-)
SET(APPLE True)
SET(BUILD_TAG "mac-x64")
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h
index 08d9b8802..219b593b0 100644
--- a/contrib/epee/include/console_handler.h
+++ b/contrib/epee/include/console_handler.h
@@ -543,6 +543,31 @@ eof:
return it->second.second;
}
+ std::vector<std::string> get_command_list(const std::vector<std::string>& keywords = std::vector<std::string>())
+ {
+ std::vector<std::string> list;
+ list.reserve(m_command_handlers.size());
+ for(auto const& x:m_command_handlers)
+ {
+ bool take = true;
+ for(auto const& y:keywords)
+ {
+ bool in_usage = x.second.second.first.find(y) != std::string::npos;
+ bool in_description = x.second.second.second.find(y) != std::string::npos;
+ if (!(in_usage || in_description))
+ {
+ take = false;
+ break;
+ }
+ }
+ if (take)
+ {
+ list.push_back(x.first);
+ }
+ }
+ return list;
+ }
+
void set_handler(const std::string& cmd, const callback& hndlr, const std::string& usage = "", const std::string& description = "")
{
lookup::mapped_type & vt = m_command_handlers[cmd];
diff --git a/contrib/epee/include/misc_language.h b/contrib/epee/include/misc_language.h
index 5f7202150..a04c63231 100644
--- a/contrib/epee/include/misc_language.h
+++ b/contrib/epee/include/misc_language.h
@@ -106,6 +106,14 @@ namespace misc_utils
return true;
}
+ template <typename T>
+ T get_mid(const T &a, const T &b)
+ {
+ //returns the average of two numbers; overflow safe and works with at least all integral and floating point types
+ //(a+b)/2 = (a/2) + (b/2) + ((a - 2*(a/2)) + (b - 2*(b/2)))/2
+ return (a/2) + (b/2) + ((a - 2*(a/2)) + (b - 2*(b/2)))/2;
+ }
+
template<class type_vec_type>
type_vec_type median(std::vector<type_vec_type> &v)
{
@@ -122,7 +130,7 @@ namespace misc_utils
return v[n];
}else
{//2, 4, 6...
- return (v[n-1] + v[n])/2;
+ return get_mid<type_vec_type>(v[n-1],v[n]);
}
}
diff --git a/contrib/epee/include/net/abstract_http_client.h b/contrib/epee/include/net/abstract_http_client.h
index 787ae2667..1f8bbc605 100644
--- a/contrib/epee/include/net/abstract_http_client.h
+++ b/contrib/epee/include/net/abstract_http_client.h
@@ -64,6 +64,7 @@ namespace http
abstract_http_client() {}
virtual ~abstract_http_client() {}
bool set_server(const std::string& address, boost::optional<login> user, ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect);
+ virtual bool set_proxy(const std::string& address);
virtual void set_server(std::string host, std::string port, boost::optional<login> user, ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect) = 0;
virtual void set_auto_connect(bool auto_connect) = 0;
virtual bool connect(std::chrono::milliseconds timeout) = 0;
diff --git a/contrib/epee/include/net/http_client.h b/contrib/epee/include/net/http_client.h
index 86df48f65..9645e896b 100644
--- a/contrib/epee/include/net/http_client.h
+++ b/contrib/epee/include/net/http_client.h
@@ -885,14 +885,6 @@ namespace net_utils
}
};
typedef http_simple_client_template<blocked_mode_client> http_simple_client;
-
- class http_simple_client_factory : public http_client_factory
- {
- public:
- std::unique_ptr<abstract_http_client> create() override {
- return std::unique_ptr<epee::net_utils::http::abstract_http_client>(new epee::net_utils::http::http_simple_client());
- }
- };
}
}
}
diff --git a/contrib/epee/include/rolling_median.h b/contrib/epee/include/rolling_median.h
index 11275aa70..088a71d3e 100644
--- a/contrib/epee/include/rolling_median.h
+++ b/contrib/epee/include/rolling_median.h
@@ -34,6 +34,8 @@
#pragma once
+#include "misc_language.h"
+
#include <stdlib.h>
#include <stdint.h>
@@ -226,7 +228,7 @@ public:
Item v = data[heap[0]];
if (minCt < maxCt)
{
- v = (v + data[heap[-1]]) / 2;
+ v = get_mid<Item>(v, data[heap[-1]]);
}
return v;
}
diff --git a/contrib/epee/src/abstract_http_client.cpp b/contrib/epee/src/abstract_http_client.cpp
index 98b5b67d9..540917873 100644
--- a/contrib/epee/src/abstract_http_client.cpp
+++ b/contrib/epee/src/abstract_http_client.cpp
@@ -137,6 +137,11 @@ namespace http
set_server(std::move(parsed.host), std::to_string(parsed.port), std::move(user), std::move(ssl_options));
return true;
}
+
+ bool epee::net_utils::http::abstract_http_client::set_proxy(const std::string& address)
+ {
+ return false;
+ }
}
}
}