mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-24 06:07:46 +00:00
http_client: allow derived class to get headers at start
This commit is contained in:
parent
e66866c1fc
commit
0d90123cac
1 changed files with 11 additions and 0 deletions
|
@ -335,6 +335,11 @@ using namespace std;
|
||||||
m_response_info.m_body += piece_of_transfer;
|
m_response_info.m_body += piece_of_transfer;
|
||||||
piece_of_transfer.clear();
|
piece_of_transfer.clear();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
virtual bool on_header(const http_response_info &headers)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
inline
|
inline
|
||||||
|
@ -505,6 +510,12 @@ using namespace std;
|
||||||
m_header_cache.erase(m_header_cache.begin()+pos+4, m_header_cache.end());
|
m_header_cache.erase(m_header_cache.begin()+pos+4, m_header_cache.end());
|
||||||
|
|
||||||
analize_cached_header_and_invoke_state();
|
analize_cached_header_and_invoke_state();
|
||||||
|
if (!on_header(m_response_info))
|
||||||
|
{
|
||||||
|
MDEBUG("Connection cancelled by on_header");
|
||||||
|
m_state = reciev_machine_state_done;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
m_header_cache.clear();
|
m_header_cache.clear();
|
||||||
if(!recv_buff.size() && (m_state != reciev_machine_state_error && m_state != reciev_machine_state_done))
|
if(!recv_buff.size() && (m_state != reciev_machine_state_error && m_state != reciev_machine_state_done))
|
||||||
need_more_data = true;
|
need_more_data = true;
|
||||||
|
|
Loading…
Reference in a new issue