diff options
Diffstat (limited to 'contrib/epee/include/net/http_client.h')
-rw-r--r-- | contrib/epee/include/net/http_client.h | 17 |
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; |