mirror of
https://github.com/zhboner/realm.git
synced 2026-11-17 08:15:55 +00:00
realm_core: switch to hook v0.1.4
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "realm_core"
|
||||
version = "0.2.3"
|
||||
version = "0.2.4"
|
||||
authors = ["Realm Contributors"]
|
||||
description = "Realm's core facilities."
|
||||
repository = "https://github.com/zhboner/realm/realm_core"
|
||||
@@ -14,7 +14,7 @@ license = "MIT"
|
||||
# realm
|
||||
realm_io = "0.2.7"
|
||||
realm_syscall = "0.1.4"
|
||||
realm_hook = { version = "0.1.3", optional = true }
|
||||
realm_hook = { version = "0.1.4", optional = true }
|
||||
kaminari = { version = "0.7.2", optional = true }
|
||||
|
||||
# other
|
||||
|
||||
@@ -22,11 +22,12 @@ pub async fn pre_connect_hook<'a>(
|
||||
while local.peek(&mut buf).await? < len {}
|
||||
}
|
||||
|
||||
let idx = decide_remote_idx(buf.as_ptr());
|
||||
let mut idx = extra_raddrs.len() as i32;
|
||||
idx = decide_remote_idx(idx, buf.as_ptr());
|
||||
|
||||
match idx {
|
||||
0 => Ok(raddr),
|
||||
i if i >= 1 && i <= extra_raddrs.len() as i32 => Ok(&extra_raddrs[i as usize - 1]),
|
||||
i if i >= 1 && i <= idx => Ok(&extra_raddrs[i as usize - 1]),
|
||||
_ => Err(Error::new(ErrorKind::Other, "rejected by pre-connect hook")),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user