ws-rs update
This commit is contained in:
@@ -15,7 +15,7 @@ rand = "0.3.14"
|
||||
jsonrpc-core = "2.0"
|
||||
log = "0.3"
|
||||
env_logger = "0.3"
|
||||
ws = { git = "https://github.com/ethcore/ws-rs.git", branch = "stable" }
|
||||
ws = { git = "https://github.com/ethcore/ws-rs.git", branch = "mio-upstream-stable" }
|
||||
ethcore-util = { path = "../util" }
|
||||
ethcore-rpc = { path = "../rpc" }
|
||||
parity-dapps-signer = { git = "https://github.com/ethcore/parity-ui.git", version = "0.6", optional = true}
|
||||
|
||||
@@ -46,7 +46,7 @@ impl TimeProvider for DefaultTimeProvider {
|
||||
}
|
||||
|
||||
/// No of seconds the hash is valid
|
||||
const TIME_THRESHOLD: u64 = 2;
|
||||
const TIME_THRESHOLD: u64 = 7;
|
||||
const TOKEN_LENGTH: usize = 16;
|
||||
|
||||
/// Manages authorization codes for `SignerUIs`
|
||||
@@ -102,7 +102,7 @@ impl<T: TimeProvider> AuthCodes<T> {
|
||||
let now = self.now.now();
|
||||
// check time
|
||||
if time >= now + TIME_THRESHOLD || time <= now - TIME_THRESHOLD {
|
||||
warn!(target: "signer", "Received old authentication request.");
|
||||
warn!(target: "signer", "Received old authentication request. ({} vs {})", now, time);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,9 @@ impl ws::Handler for Session {
|
||||
fn on_message(&mut self, msg: ws::Message) -> ws::Result<()> {
|
||||
let req = try!(msg.as_text());
|
||||
match self.handler.handle_request(req) {
|
||||
Some(res) => self.out.send(res),
|
||||
Some(res) => {
|
||||
self.out.send(res)
|
||||
},
|
||||
None => Ok(()),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user