Refactor into system service, add exe redirect.

This commit is contained in:
Gav Wood
2016-12-10 23:58:39 +01:00
parent 316c25d9f8
commit fa30dfd4b9
18 changed files with 392 additions and 383 deletions

View File

@@ -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)
}