aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/http_client.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-15 20:31:16 -0500
committerRiccardo Spagni <ric@spagni.net>2017-01-15 20:31:16 -0500
commitac7df193ca47261c2dfd91b230489e20955013a2 (patch)
treee4d312059948a0528583e7ea58d2c0b40307a494 /contrib/epee/include/net/http_client.h
parentMerge pull request #1578 (diff)
parentChange logging to easylogging++ (diff)
downloadmonero-ac7df193ca47261c2dfd91b230489e20955013a2.tar.xz
Merge pull request #1522
5833d66f Change logging to easylogging++ (moneromooo-monero) dc98019b easylogging++: fix logging with static const header only data members (moneromooo-monero) 3b46617b easylogging++: add ELPP_DISABLE_CHECK_MACROS (moneromooo-monero) 6fe39d90 easylogging++: allow clipping a common filename prefix (moneromooo-monero) 43abf6ff easylogging++: add file-only logs (moneromooo-monero) c313bea4 eayslogging++: Fix bad memory access before opening any files (moneromooo-monero) 0af5d168 easylogging++: avoid creating directory/filename for the builtin default log file (moneromooo-monero) 28362847 easylogging++: allow setting thread names (moneromooo-monero) ec71ce8d easylogging++: Print thread ID in a nicer way (moneromooo-monero) 2a0bf783 easylogging++: Add logging categories (moneromooo-monero) c50bbbfe easylogging++: import upstream (moneromooo-monero)
Diffstat (limited to 'contrib/epee/include/net/http_client.h')
-rw-r--r--contrib/epee/include/net/http_client.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/contrib/epee/include/net/http_client.h b/contrib/epee/include/net/http_client.h
index 336153384..a54318ebb 100644
--- a/contrib/epee/include/net/http_client.h
+++ b/contrib/epee/include/net/http_client.h
@@ -52,6 +52,9 @@
//#pragma comment(lib, "shlwapi.lib")
+#undef MONERO_DEFAULT_LOG_CATEGORY
+#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
+
extern epee::critical_section gregexp_lock;
@@ -325,10 +328,10 @@ using namespace std;
CRITICAL_REGION_LOCAL(m_lock);
if(!is_connected())
{
- LOG_PRINT("Reconnecting...", LOG_LEVEL_3);
+ MDEBUG("Reconnecting...");
if(!connect(m_host_buff, m_port, m_timeout))
{
- LOG_PRINT("Failed to connect to " << m_host_buff << ":" << m_port, LOG_LEVEL_3);
+ MDEBUG("Failed to connect to " << m_host_buff << ":" << m_port);
return false;
}
}
@@ -376,7 +379,7 @@ using namespace std;
{
if(!m_net_client.recv(recv_buffer))
{
- LOG_PRINT("Unexpected reciec fail", LOG_LEVEL_3);
+ MERROR("Unexpected recv fail");
m_state = reciev_machine_state_error;
}
if(!recv_buffer.size())
@@ -464,7 +467,7 @@ using namespace std;
CRITICAL_REGION_LOCAL(m_lock);
if(!recv_buff.size())
{
- LOG_PRINT("Warning: Content-Len mode, but connection unexpectedly closed", LOG_LEVEL_3);
+ MERROR("Warning: Content-Len mode, but connection unexpectedly closed");
m_state = reciev_machine_state_done;
return true;
}
@@ -578,7 +581,7 @@ using namespace std;
CRITICAL_REGION_LOCAL(m_lock);
if(!recv_buff.size())
{
- LOG_PRINT("Warning: CHUNKED mode, but connection unexpectedly closed", LOG_LEVEL_3);
+ MERROR("Warning: CHUNKED mode, but connection unexpectedly closed");
m_state = reciev_machine_state_done;
return true;
}
@@ -665,7 +668,7 @@ using namespace std;
inline
bool parse_header(http_header_info& body_info, const std::string& m_cache_to_process)
{
- LOG_FRAME("http_stream_filter::parse_cached_header(*)", LOG_LEVEL_4);
+ MTRACE("http_stream_filter::parse_cached_header(*)");
STATIC_REGEXP_EXPR_1(rexp_mach_field,
"\n?((Connection)|(Referer)|(Content-Length)|(Content-Type)|(Transfer-Encoding)|(Content-Encoding)|(Host)|(Cookie)|(User-Agent)"
@@ -833,7 +836,7 @@ using namespace std;
}else
{ //Apparently there are no signs of the form of transfer, will receive data until the connection is closed
m_state = reciev_machine_state_error;
- LOG_PRINT("Undefinded transfer type, consider http_body_transfer_connection_close method. header: " << m_header_cache, LOG_LEVEL_2);
+ MERROR("Undefinded transfer type, consider http_body_transfer_connection_close method. header: " << m_header_cache);
return false;
}
return false;