diff options
author | Jeffrey Ryan <jeffreyryan@tutanota.com> | 2022-11-08 17:41:37 -0600 |
---|---|---|
committer | Jeffrey Ryan <jeffreyryan@tutanota.com> | 2022-11-13 20:27:21 -0600 |
commit | ab7102e31fe53e11eae240440f1aa5eb1da88ddf (patch) | |
tree | ee64fd2cbb42d34da28f1545c1973d34acb22c97 /contrib/epee/include/net | |
parent | Merge pull request #8593 (diff) | |
download | monero-ab7102e31fe53e11eae240440f1aa5eb1da88ddf.tar.xz |
epee: remove dead HTTP code
http_client.h
Diffstat (limited to 'contrib/epee/include/net')
-rw-r--r-- | contrib/epee/include/net/abstract_http_client.h | 1 | ||||
-rw-r--r-- | contrib/epee/include/net/http_base.h | 12 | ||||
-rw-r--r-- | contrib/epee/include/net/http_client.h | 52 |
3 files changed, 0 insertions, 65 deletions
diff --git a/contrib/epee/include/net/abstract_http_client.h b/contrib/epee/include/net/abstract_http_client.h index 5270824e1..46b3747cd 100644 --- a/contrib/epee/include/net/abstract_http_client.h +++ b/contrib/epee/include/net/abstract_http_client.h @@ -72,7 +72,6 @@ namespace http virtual bool is_connected(bool *ssl = NULL) = 0; virtual bool invoke(const boost::string_ref uri, const boost::string_ref method, const boost::string_ref body, std::chrono::milliseconds timeout, const http_response_info** ppresponse_info = NULL, const fields_list& additional_params = fields_list()) = 0; virtual bool invoke_get(const boost::string_ref uri, std::chrono::milliseconds timeout, const std::string& body = std::string(), const http_response_info** ppresponse_info = NULL, const fields_list& additional_params = fields_list()) = 0; - virtual bool invoke_post(const boost::string_ref uri, const std::string& body, std::chrono::milliseconds timeout, const http_response_info** ppresponse_info = NULL, const fields_list& additional_params = fields_list()) = 0; virtual uint64_t get_bytes_sent() const = 0; virtual uint64_t get_bytes_received() const = 0; }; diff --git a/contrib/epee/include/net/http_base.h b/contrib/epee/include/net/http_base.h index 4af4da790..15fd30bf3 100644 --- a/contrib/epee/include/net/http_base.h +++ b/contrib/epee/include/net/http_base.h @@ -55,20 +55,8 @@ namespace net_utils http_method_unknown }; - enum http_content_type - { - http_content_type_text_html, - http_content_type_image_gif, - http_content_type_other, - http_content_type_not_set - }; - typedef std::list<std::pair<std::string, std::string> > fields_list; - std::string get_value_from_fields_list(const std::string& param_name, const net_utils::http::fields_list& fields); - - std::string get_value_from_uri_line(const std::string& param_name, const std::string& uri); - static inline void add_field(std::string& out, const boost::string_ref name, const boost::string_ref value) { out.append(name.data(), name.size()).append(": "); diff --git a/contrib/epee/include/net/http_client.h b/contrib/epee/include/net/http_client.h index 9ce30b620..8cee399cb 100644 --- a/contrib/epee/include/net/http_client.h +++ b/contrib/epee/include/net/http_client.h @@ -32,7 +32,6 @@ #include <boost/regex.hpp> #include <boost/optional/optional.hpp> #include <boost/utility/string_ref.hpp> -//#include <mbstring.h> #include <algorithm> #include <cctype> #include <functional> @@ -48,57 +47,13 @@ #include "net_parse_helpers.h" #include "syncobj.h" -//#include "shlwapi.h" - -//#pragma comment(lib, "shlwapi.lib") - #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "net.http" -extern epee::critical_section gregexp_lock; - - namespace epee { namespace net_utils { - - /*struct url - { - public: - void parse(const std::string& url_s) - { - const string prot_end("://"); - string::const_iterator prot_i = search(url_s.begin(), url_s.end(), - prot_end.begin(), prot_end.end()); - protocol_.reserve(distance(url_s.begin(), prot_i)); - transform(url_s.begin(), prot_i, - back_inserter(protocol_), - ptr_fun<int,int>(tolower)); // protocol is icase - if( prot_i == url_s.end() ) - return; - advance(prot_i, prot_end.length()); - string::const_iterator path_i = find(prot_i, url_s.end(), '/'); - host_.reserve(distance(prot_i, path_i)); - transform(prot_i, path_i, - back_inserter(host_), - ptr_fun<int,int>(tolower)); // host is icase - string::const_iterator query_i = find(path_i, url_s.end(), '?'); - path_.assign(path_i, query_i); - if( query_i != url_s.end() ) - ++query_i; - query_.assign(query_i, url_s.end()); - } - - std::string protocol_; - std::string host_; - std::string path_; - std::string query_; - };*/ - - - - //--------------------------------------------------------------------------- namespace http { @@ -135,7 +90,6 @@ namespace net_utils http_response_info m_response_info; size_t m_len_in_summary; size_t m_len_in_remain; - //std::string* m_ptarget_buffer; boost::shared_ptr<i_sub_handler> m_pcontent_encoding_handler; reciev_machine_state m_state; chunked_state m_chunked_state; @@ -300,12 +254,6 @@ namespace net_utils return false; } //--------------------------------------------------------------------------- - inline bool invoke_post(const boost::string_ref uri, const std::string& body, std::chrono::milliseconds timeout, const http_response_info** ppresponse_info = NULL, const fields_list& additional_params = fields_list()) override - { - CRITICAL_REGION_LOCAL(m_lock); - return invoke(uri, "POST", body, timeout, ppresponse_info, additional_params); - } - //--------------------------------------------------------------------------- bool test(const std::string &s, std::chrono::milliseconds timeout) // TEST FUNC ONLY { CRITICAL_REGION_LOCAL(m_lock); |