mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
merge chunked responses
This commit is contained in:
parent
325117114a
commit
3f314d8355
4 changed files with 51 additions and 6 deletions
|
@ -290,7 +290,7 @@ namespace client
|
|||
|
||||
}
|
||||
|
||||
void AddressBook::LoadHostsFromStream (std::istream& f, bool isChunked)
|
||||
void AddressBook::LoadHostsFromStream (std::istream& f)
|
||||
{
|
||||
std::unique_lock<std::mutex> l(m_AddressBookMutex);
|
||||
int numAddresses = 0;
|
||||
|
@ -432,7 +432,17 @@ namespace client
|
|||
}
|
||||
}
|
||||
if (!response.eof ())
|
||||
m_Book.LoadHostsFromStream (response, isChunked);
|
||||
{
|
||||
if (!isChunked)
|
||||
m_Book.LoadHostsFromStream (response);
|
||||
else
|
||||
{
|
||||
// merge chunks
|
||||
std::stringstream merged;
|
||||
i2p::util::http::MergeChunkedResponse (response, merged);
|
||||
m_Book.LoadHostsFromStream (merged);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
LogPrint (eLogWarning, "Adressbook HTTP response ", status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue