Refactor into system service, add exe redirect.
This commit is contained in:
@@ -84,7 +84,7 @@ impl Client {
|
||||
|
||||
impl HashFetch for Client {
|
||||
fn fetch(&self, hash: H256, on_done: Box<Fn(Result<PathBuf, Error>) + Send>) -> Result<(), Error> {
|
||||
debug!(target: "dapps", "Fetching: {:?}", hash);
|
||||
debug!(target: "fetch", "Fetching: {:?}", hash);
|
||||
|
||||
let url = try!(
|
||||
self.contract.resolve(hash.to_vec()).map(|content| match content {
|
||||
@@ -97,7 +97,7 @@ impl HashFetch for Client {
|
||||
}).ok_or_else(|| Error::NoResolution)
|
||||
);
|
||||
|
||||
debug!(target: "dapps", "Resolved {:?} to {:?}. Fetching...", hash, url);
|
||||
debug!(target: "fetch", "Resolved {:?} to {:?}. Fetching...", hash, url);
|
||||
|
||||
self.fetch.lock().request_async(&url, Default::default(), Box::new(move |result| {
|
||||
fn validate_hash(hash: H256, result: Result<PathBuf, FetchError>) -> Result<PathBuf, Error> {
|
||||
@@ -112,7 +112,7 @@ impl HashFetch for Client {
|
||||
}
|
||||
}
|
||||
|
||||
debug!(target: "dapps", "Content fetched, validating hash ({:?})", hash);
|
||||
debug!(target: "fetch", "Content fetched, validating hash ({:?})", hash);
|
||||
on_done(validate_hash(hash, result))
|
||||
})).map_err(Into::into)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user