diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/depends/packages/expat.mk | 6 | ||||
-rw-r--r-- | contrib/depends/packages/openssl.mk | 15 | ||||
-rw-r--r-- | contrib/depends/packages/unbound.mk | 1 | ||||
-rw-r--r-- | contrib/epee/include/net/abstract_http_client.h | 1 | ||||
-rw-r--r-- | contrib/epee/include/net/abstract_tcp_server2.inl | 5 | ||||
-rw-r--r-- | contrib/epee/include/net/levin_protocol_handler_async.h | 88 | ||||
-rw-r--r-- | contrib/epee/include/storages/http_abstract_invoke.h | 20 | ||||
-rw-r--r-- | contrib/epee/include/string_coding.h | 2 | ||||
-rw-r--r-- | contrib/epee/src/abstract_http_client.cpp | 10 |
9 files changed, 20 insertions, 128 deletions
diff --git a/contrib/depends/packages/expat.mk b/contrib/depends/packages/expat.mk index 9516f86ab..c9d3e0064 100644 --- a/contrib/depends/packages/expat.mk +++ b/contrib/depends/packages/expat.mk @@ -1,8 +1,8 @@ package=expat -$(package)_version=2.4.1 -$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_4_1 +$(package)_version=2.5.0 +$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_5_0 $(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=2f9b6a580b94577b150a7d5617ad4643a4301a6616ff459307df3e225bcfbf40 +$(package)_sha256_hash=6f0e6e01f7b30025fa05c85fdad1e5d0ec7fd35d9f61b22f34998de11969ff67 define $(package)_set_vars $(package)_config_opts=--enable-static diff --git a/contrib/depends/packages/openssl.mk b/contrib/depends/packages/openssl.mk index 990b85093..bdfb031ed 100644 --- a/contrib/depends/packages/openssl.mk +++ b/contrib/depends/packages/openssl.mk @@ -1,20 +1,19 @@ package=openssl -$(package)_version=1.1.1t +$(package)_version=3.0.9 $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b +$(package)_sha256_hash=eb1ab04781474360f77c318ab89d8c5a03abc38e63d65a603cabbf1b00a1dc90 define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" ARFLAGS=$($(package)_arflags) RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" -$(package)_config_env_android=ANDROID_NDK_HOME="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB=ranlib -$(package)_build_env_android=ANDROID_NDK_HOME="$(host_prefix)/native" -$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl +$(package)_config_env_android=ANDROID_NDK_ROOT="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB=ranlib +$(package)_build_env_android=ANDROID_NDK_ROOT="$(host_prefix)/native" +$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl --libdir=$(host_prefix)/lib $(package)_config_opts+=no-capieng $(package)_config_opts+=no-dso $(package)_config_opts+=no-dtls1 $(package)_config_opts+=no-ec_nistp_64_gcc_128 $(package)_config_opts+=no-gost -$(package)_config_opts+=no-heartbeats $(package)_config_opts+=no-md2 $(package)_config_opts+=no-rc5 $(package)_config_opts+=no-rdrand @@ -22,8 +21,8 @@ $(package)_config_opts+=no-rfc3779 $(package)_config_opts+=no-sctp $(package)_config_opts+=no-shared $(package)_config_opts+=no-ssl-trace -$(package)_config_opts+=no-ssl2 $(package)_config_opts+=no-ssl3 +$(package)_config_opts+=no-tests $(package)_config_opts+=no-unit-test $(package)_config_opts+=no-weak-ssl-ciphers $(package)_config_opts+=no-zlib @@ -49,7 +48,7 @@ $(package)_config_opts_x86_64_freebsd=BSD-x86_64 endef define $(package)_preprocess_cmds - sed -i.old 's|"engines", "apps", "test", "util", "tools", "fuzz"|"engines", "tools"|' Configure + sed -i.old 's|crypto ssl apps util tools fuzz providers doc|crypto ssl util tools providers|' build.info endef define $(package)_config_cmds diff --git a/contrib/depends/packages/unbound.mk b/contrib/depends/packages/unbound.mk index 421c51f7f..166cc3f79 100644 --- a/contrib/depends/packages/unbound.mk +++ b/contrib/depends/packages/unbound.mk @@ -11,6 +11,7 @@ define $(package)_set_vars $(package)_config_opts=--disable-shared --enable-static --without-pyunbound --prefix=$(host_prefix) --with-libexpat=$(host_prefix) --with-ssl=$(host_prefix) --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only $(package)_config_opts_linux=--with-pic $(package)_config_opts_w64=--enable-static-exe --sysconfdir=/etc --prefix=$(host_prefix) --target=$(host_prefix) + $(package)_config_opts_x86_64_darwin=ac_cv_func_SHA384_Init=yes $(package)_build_opts_mingw32=LDFLAGS="$($(package)_ldflags) -lpthread" endef diff --git a/contrib/epee/include/net/abstract_http_client.h b/contrib/epee/include/net/abstract_http_client.h index 46b3747cd..29a7ce19b 100644 --- a/contrib/epee/include/net/abstract_http_client.h +++ b/contrib/epee/include/net/abstract_http_client.h @@ -54,7 +54,6 @@ namespace net_utils std::string convert(char val); std::string conver_to_url_format(const std::string& uri); std::string convert_from_url_format(const std::string& uri); - std::string convert_to_url_format_force_all(const std::string& uri); namespace http { diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index 81aa725d1..d88f18194 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -583,11 +583,8 @@ namespace net_utils break; } } - else if (ec.value()) - terminate(); else { - cancel_timer(); - on_interrupted(); + terminate(); } }; m_strand.post( diff --git a/contrib/epee/include/net/levin_protocol_handler_async.h b/contrib/epee/include/net/levin_protocol_handler_async.h index bd6ffe930..5122f1677 100644 --- a/contrib/epee/include/net/levin_protocol_handler_async.h +++ b/contrib/epee/include/net/levin_protocol_handler_async.h @@ -102,7 +102,6 @@ public: uint64_t m_max_packet_size; uint64_t m_invoke_timeout; - int invoke(int command, message_writer in_msg, std::string& buff_out, boost::uuids::uuid connection_id); template<class callback_t> int invoke_async(int command, message_writer in_msg, boost::uuids::uuid connection_id, const callback_t &cb, size_t timeout = LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED); @@ -165,14 +164,6 @@ public: }; std::atomic<bool> m_protocol_released; - std::atomic<bool> m_invoke_buf_ready; - - volatile int m_invoke_result_code; - - critical_section m_local_inv_buff_lock; - std::string m_local_inv_buff; - - critical_section m_call_lock; std::atomic<uint32_t> m_wait_count; std::atomic<uint32_t> m_close_called; @@ -318,8 +309,6 @@ public: m_wait_count = 0; m_oponent_protocol_ver = 0; m_connection_initialized = false; - m_invoke_buf_ready = false; - m_invoke_result_code = LEVIN_ERROR_CONNECTION; } virtual ~async_protocol_handler() { @@ -521,21 +510,8 @@ public: } else { - invoke_response_handlers_guard.unlock(); - //use sync call scenario - if(!m_wait_count && !m_close_called) - { - MERROR(m_connection_context << "no active invoke when response came, wtf?"); - return false; - }else - { - CRITICAL_REGION_BEGIN(m_local_inv_buff_lock); - m_local_inv_buff = std::string((const char*)buff_to_invoke.data(), buff_to_invoke.size()); - buff_to_invoke = epee::span<const uint8_t>((const uint8_t*)NULL, 0); - m_invoke_result_code = m_current_head.m_return_code; - CRITICAL_REGION_END(); - m_invoke_buf_ready = true; - } + MERROR("Received levin response but have no invoke handlers"); + return false; } }else { @@ -639,9 +615,6 @@ public: int err_code = LEVIN_OK; do { - CRITICAL_REGION_LOCAL(m_call_lock); - - m_invoke_buf_ready = false; CRITICAL_REGION_BEGIN(m_invoke_response_handlers_lock); if (command == m_connection_context.handshake_command()) @@ -673,55 +646,6 @@ public: return true; } - int invoke(int command, message_writer in_msg, std::string& buff_out) - { - misc_utils::auto_scope_leave_caller scope_exit_handler = misc_utils::create_scope_leave_handler( - boost::bind(&async_protocol_handler::finish_outer_call, this)); - - CRITICAL_REGION_LOCAL(m_call_lock); - - m_invoke_buf_ready = false; - - if (command == m_connection_context.handshake_command()) - m_max_packet_size = m_config.m_max_packet_size; - - if (!send_message(in_msg.finalize_invoke(command))) - { - LOG_ERROR_CC(m_connection_context, "Failed to send request"); - return LEVIN_ERROR_CONNECTION; - } - - uint64_t ticks_start = misc_utils::get_tick_count(); - size_t prev_size = 0; - - while(!m_invoke_buf_ready && !m_protocol_released) - { - if(m_cache_in_buffer.size() - prev_size >= MIN_BYTES_WANTED) - { - prev_size = m_cache_in_buffer.size(); - ticks_start = misc_utils::get_tick_count(); - } - if(misc_utils::get_tick_count() - ticks_start > m_config.m_invoke_timeout) - { - MWARNING(m_connection_context << "invoke timeout (" << m_config.m_invoke_timeout << "), closing connection "); - close(); - return LEVIN_ERROR_CONNECTION_TIMEDOUT; - } - if(!m_pservice_endpoint->call_run_once_service_io()) - return LEVIN_ERROR_CONNECTION_DESTROYED; - } - - if(m_protocol_released) - return LEVIN_ERROR_CONNECTION_DESTROYED; - - CRITICAL_REGION_BEGIN(m_local_inv_buff_lock); - buff_out.swap(m_local_inv_buff); - m_local_inv_buff.clear(); - CRITICAL_REGION_END(); - - return m_invoke_result_code; - } - /*! Sends `message` without adding a levin header. The message must have been created with `make_noise_notify`, `make_fragmented_notify`, or `message_writer::finalize_notify`. See additional instructions for @@ -827,14 +751,6 @@ int async_protocol_handler_config<t_connection_context>::find_and_lock_connectio return LEVIN_OK; } //------------------------------------------------------------------------------------------ -template<class t_connection_context> -int async_protocol_handler_config<t_connection_context>::invoke(int command, message_writer in_msg, std::string& buff_out, boost::uuids::uuid connection_id) -{ - async_protocol_handler<t_connection_context>* aph; - int r = find_and_lock_connection(connection_id, aph); - return LEVIN_OK == r ? aph->invoke(command, std::move(in_msg), buff_out) : r; -} -//------------------------------------------------------------------------------------------ template<class t_connection_context> template<class callback_t> int async_protocol_handler_config<t_connection_context>::invoke_async(int command, message_writer in_msg, boost::uuids::uuid connection_id, const callback_t &cb, size_t timeout) { diff --git a/contrib/epee/include/storages/http_abstract_invoke.h b/contrib/epee/include/storages/http_abstract_invoke.h index c615b20e6..aaeae292f 100644 --- a/contrib/epee/include/storages/http_abstract_invoke.h +++ b/contrib/epee/include/storages/http_abstract_invoke.h @@ -26,13 +26,10 @@ // #pragma once -#include <boost/utility/string_ref.hpp> -#include <chrono> -#include <string> -#include "byte_slice.h" -#include "portable_storage_template_helper.h" + #include "net/http_base.h" -#include "net/http_server_handlers_map2.h" +#include "net/jsonrpc_structs.h" +#include "portable_storage_template_helper.h" namespace epee { @@ -136,12 +133,5 @@ namespace epee epee::json_rpc::error error_struct; return invoke_http_json_rpc(uri, method_name, out_struct, result_struct, error_struct, transport, timeout, http_method, req_id); } - - template<class t_command, class t_transport> - bool invoke_http_json_rpc(const boost::string_ref uri, typename t_command::request& out_struct, typename t_command::response& result_struct, t_transport& transport, std::chrono::milliseconds timeout = std::chrono::seconds(15), const boost::string_ref http_method = "POST", const std::string& req_id = "0") - { - return invoke_http_json_rpc(uri, t_command::methodname(), out_struct, result_struct, transport, timeout, http_method, req_id); - } - - } -} + } // namespace net_utils +} // namespace epee diff --git a/contrib/epee/include/string_coding.h b/contrib/epee/include/string_coding.h index 0d9c6c244..1e9da6fb2 100644 --- a/contrib/epee/include/string_coding.h +++ b/contrib/epee/include/string_coding.h @@ -35,7 +35,7 @@ namespace epee namespace string_encoding { inline - std::string& base64_chars() + const std::string& base64_chars() { static std::string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" diff --git a/contrib/epee/src/abstract_http_client.cpp b/contrib/epee/src/abstract_http_client.cpp index 3ae09c90e..8897ad9ae 100644 --- a/contrib/epee/src/abstract_http_client.cpp +++ b/contrib/epee/src/abstract_http_client.cpp @@ -116,16 +116,6 @@ namespace net_utils return result; } //---------------------------------------------------------------------------------------------------- - std::string convert_to_url_format_force_all(const std::string& uri) - { - std::string result; - - for(size_t i = 0; i!= uri.size(); i++) - { - result += convert(uri[i]); - } - return result; - } namespace http { |