forked from lthn/blockchain
epee:: http_client & gzip_encoding: fixed improper handling of incorrect gzip data during downloading
This commit is contained in:
parent
cf932f50e7
commit
40097d776b
2 changed files with 12 additions and 1 deletions
|
|
@ -150,6 +150,10 @@ namespace net_utils
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CHECK_AND_ASSERT_MES(Z_DATA_ERROR != ret, false, "content_encoding_gzip::update_in() Failed to inflate. err = Z_DATA_ERROR");
|
||||
}
|
||||
|
||||
|
||||
//leave only unpacked part in the output buffer to start with it the next time
|
||||
|
|
|
|||
|
|
@ -464,7 +464,14 @@ using namespace std;
|
|||
}
|
||||
CHECK_AND_ASSERT_MES(m_len_in_remain >= recv_buff.size(), false, "m_len_in_remain >= recv_buff.size()");
|
||||
m_len_in_remain -= recv_buff.size();
|
||||
m_pcontent_encoding_handler->update_in(recv_buff);
|
||||
bool r = m_pcontent_encoding_handler->update_in(recv_buff);
|
||||
//CHECK_AND_ASSERT_MES(m_len_in_remain >= recv_buff.size(), false, "m_pcontent_encoding_handler->update_in returned false");
|
||||
if (!r)
|
||||
{
|
||||
m_state = reciev_machine_state_error;
|
||||
disconnect();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(m_len_in_remain == 0)
|
||||
m_state = reciev_machine_state_done;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue