Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Increase max download limit to 128MB (#7965)
Browse files Browse the repository at this point in the history
* fetch: increase max download limit to 64MB

* parity: increase download size limit for updater service
  • Loading branch information
andresilva authored and tomusdrw committed Feb 27, 2018
1 parent 2490a49 commit 56345d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion parity/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,15 @@ pub fn execute_impl(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>)
let event_loop = EventLoop::spawn();

// the updater service
let mut updater_fetch = fetch.clone();
// parity binaries should be smaller than 128MB
updater_fetch.set_limit(Some(128 * 1024 * 1024));

let updater = Updater::new(
Arc::downgrade(&(service.client() as Arc<BlockChainClient>)),
Arc::downgrade(&sync_provider),
update_policy,
fetch.clone(),
updater_fetch,
event_loop.remote(),
);
service.add_notify(updater.clone());
Expand Down
9 changes: 7 additions & 2 deletions util/fetch/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down

0 comments on commit 56345d7

Please sign in to comment.