[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user