diff --git a/doc/log_stats.plot b/doc/log_stats.plot index 1e16437a..e3c2bc70 100644 --- a/doc/log_stats.plot +++ b/doc/log_stats.plot @@ -25,9 +25,7 @@ set format x "%H:%M" set format y "%.0s %cb" set format y2 "%.0f" set y2tics -set autoscale x - -#set multiplot +set autoscale xfix grab(x)=(xmax)?max=x:0; @@ -37,8 +35,6 @@ plot "bandwidth_stats.$1" using 1:2 smooth bezier with lines lw 4 title 'Upload "bandwidth_stats.$1" using 1:6 smooth bezier with lines lw 2 title 'Upload unchoked' axis x1y2,\ "bandwidth_stats.$1" using 1:7 smooth bezier with lines lw 2 title 'Download unchoked' axis x1y2 -set autoscale xfix - set output "output_$1_memory.png" plot "bandwidth_stats.$1" using 1:9 smooth bezier with lines lw 4 title 'Memory usage' axis x1y1,\ "bandwidth_stats.$1" using 1:6 smooth bezier with lines lw 2 title 'Upload unchoked' axis x1y2,\ diff --git a/src/command_network.cc b/src/command_network.cc index f2adcf93..f1ec9d14 100644 --- a/src/command_network.cc +++ b/src/command_network.cc @@ -674,14 +674,16 @@ initialize_command_network() { CMD2_ANY_STRING ("throttle.down.max", std::bind(&retrieve_throttle_info, std::placeholders::_2, throttle_info_down | throttle_info_max)); CMD2_ANY_STRING ("throttle.down.rate", std::bind(&retrieve_throttle_info, std::placeholders::_2, throttle_info_down | throttle_info_rate)); - CMD2_ANY ("network.http.capath", std::bind(&core::CurlStack::http_capath, httpStack)); - CMD2_ANY_STRING_V("network.http.capath.set", std::bind(&core::CurlStack::set_http_capath, httpStack, std::placeholders::_2)); - CMD2_ANY ("network.http.cacert", std::bind(&core::CurlStack::http_cacert, httpStack)); - CMD2_ANY_STRING_V("network.http.cacert.set", std::bind(&core::CurlStack::set_http_cacert, httpStack, std::placeholders::_2)); - CMD2_ANY ("network.http.proxy_address", std::bind(&core::CurlStack::http_proxy, httpStack)); - CMD2_ANY_STRING_V("network.http.proxy_address.set", std::bind(&core::CurlStack::set_http_proxy, httpStack, std::placeholders::_2)); - CMD2_ANY ("network.http.max_open", std::bind(&core::CurlStack::max_active, httpStack)); - CMD2_ANY_VALUE_V ("network.http.max_open.set", std::bind(&core::CurlStack::set_max_active, httpStack, std::placeholders::_2)); + CMD2_ANY ("network.http.capath", std::bind(&core::CurlStack::http_capath, httpStack)); + CMD2_ANY_STRING_V("network.http.capath.set", std::bind(&core::CurlStack::set_http_capath, httpStack, std::placeholders::_2)); + CMD2_ANY ("network.http.cacert", std::bind(&core::CurlStack::http_cacert, httpStack)); + CMD2_ANY_STRING_V("network.http.cacert.set", std::bind(&core::CurlStack::set_http_cacert, httpStack, std::placeholders::_2)); + CMD2_ANY ("network.http.proxy_address", std::bind(&core::CurlStack::http_proxy, httpStack)); + CMD2_ANY_STRING_V("network.http.proxy_address.set", std::bind(&core::CurlStack::set_http_proxy, httpStack, std::placeholders::_2)); + CMD2_ANY ("network.http.max_open", std::bind(&core::CurlStack::max_active, httpStack)); + CMD2_ANY_VALUE_V ("network.http.max_open.set", std::bind(&core::CurlStack::set_max_active, httpStack, std::placeholders::_2)); + CMD2_ANY ("network.http.ssl_verify_peer", std::bind(&core::CurlStack::ssl_verify_peer, httpStack)); + CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set", std::bind(&core::CurlStack::set_ssl_verify_peer, httpStack, std::placeholders::_2)); CMD2_ANY ("network.send_buffer.size", std::bind(&torrent::ConnectionManager::send_buffer_size, cm)); CMD2_ANY_VALUE_V ("network.send_buffer.size.set", std::bind(&torrent::ConnectionManager::set_send_buffer_size, cm, std::placeholders::_2)); diff --git a/src/core/curl_stack.cc b/src/core/curl_stack.cc index 3adfab5d..4f54a0d9 100644 --- a/src/core/curl_stack.cc +++ b/src/core/curl_stack.cc @@ -51,7 +51,8 @@ namespace core { CurlStack::CurlStack() : m_handle((void*)curl_multi_init()), m_active(0), - m_maxActive(32) { + m_maxActive(32), + m_ssl_verify_peer(true) { m_taskTimeout.set_slot(rak::mem_fn(this, &CurlStack::receive_timeout)); @@ -164,6 +165,9 @@ CurlStack::add_get(CurlGet* get) { if (!m_httpCaCert.empty()) curl_easy_setopt(get->handle(), CURLOPT_CAINFO, m_httpCaCert.c_str()); + if (!m_ssl_verify_peer) + curl_easy_setopt(get->handle(), CURLOPT_SSL_VERIFYPEER, 0); + base_type::push_back(get); if (m_active >= m_maxActive) diff --git a/src/core/curl_stack.h b/src/core/curl_stack.h index 09cc8180..68b9f3f6 100644 --- a/src/core/curl_stack.h +++ b/src/core/curl_stack.h @@ -104,6 +104,9 @@ class CurlStack : std::deque { const std::string& http_cacert() const { return m_httpCaCert; } void set_http_cacert(const std::string& s) { m_httpCaCert = s; } + bool ssl_verify_peer() const { return m_ssl_verify_peer; } + void set_ssl_verify_peer(bool s) { m_ssl_verify_peer = s; } + static void global_init(); static void global_cleanup(); @@ -135,6 +138,7 @@ class CurlStack : std::deque { std::string m_bindAddress; std::string m_httpCaPath; std::string m_httpCaCert; + bool m_ssl_verify_peer; }; }