1
0
Fork 0
forked from lthn/blockchain

epee:: http_client & gzip_encoding: fixed improper handling of incorrect gzip data during downloading

This commit is contained in:
sowle 2020-03-18 15:22:20 +03:00
parent cf932f50e7
commit 40097d776b
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 12 additions and 1 deletions

View file

@ -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

View file

@ -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;