[stable] Backports (#8008)

* Detect too large packets in snapshot sync. (#7977)

* Increase max download limit to 128MB (#7965)

* fetch: increase max download limit to 64MB

* parity: increase download size limit for updater service

* Calculate proper keccak256/sha3 using parity. (#7953)

* Bump WS (#7952)
This commit is contained in:
Tomasz Drwięga
2018-02-27 20:07:23 +01:00
committed by Rando
parent a51e4d5d13
commit 2738c5cd74
7 changed files with 38 additions and 16 deletions

View File

@@ -127,6 +127,11 @@ impl Client {
})
}
/// Sets a limit on the maximum download size.
pub fn set_limit(&mut self, limit: Option<usize>) {
self.limit = limit
}
fn client(&self) -> Result<Arc<reqwest::Client>, Error> {
{
let (ref time, ref client) = *self.client.read();
@@ -150,8 +155,8 @@ impl Fetch for Client {
type Result = CpuFuture<Response, Error>;
fn new() -> Result<Self, Error> {
// Max 50MB will be downloaded.
Self::with_limit(Some(50*1024*1024))
// Max 64MB will be downloaded.
Self::with_limit(Some(64 * 1024 * 1024))
}
fn process<F, I, E>(&self, f: F) -> BoxFuture<I, E> where