temporarly removing reqwest to test on openbsd

pull/19/head
Niko PLP 1 year ago
parent bce94d8e9c
commit dce163bfda
  1. 120
      Cargo.lock
  2. 2
      p2p-net/Cargo.toml
  3. 52
      p2p-net/src/types.rs
  4. 40
      p2p-net/src/utils.rs

120
Cargo.lock generated

@ -153,7 +153,7 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
dependencies = [
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -163,7 +163,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188"
dependencies = [
"anstyle",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -324,7 +324,7 @@ dependencies = [
"futures-lite",
"rustix",
"signal-hook",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -1410,7 +1410,7 @@ checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
dependencies = [
"errno-dragonfly",
"libc",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -2206,19 +2206,6 @@ dependencies = [
"want",
]
[[package]]
name = "hyper-tls"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
"bytes",
"hyper",
"native-tls",
"tokio",
"tokio-native-tls",
]
[[package]]
name = "iana-time-zone"
version = "0.1.57"
@ -2339,7 +2326,7 @@ checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
dependencies = [
"hermit-abi 0.3.1",
"libc",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -2357,7 +2344,7 @@ dependencies = [
"hermit-abi 0.3.1",
"io-lifetimes",
"rustix",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -2725,7 +2712,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
dependencies = [
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -2755,24 +2742,6 @@ dependencies = [
"getrandom 0.2.10",
]
[[package]]
name = "native-tls"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
dependencies = [
"lazy_static",
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]]
name = "ndk"
version = "0.6.0"
@ -3200,12 +3169,6 @@ dependencies = [
"syn 2.0.18",
]
[[package]]
name = "openssl-probe"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
version = "111.26.0+1.1.1u"
@ -3313,7 +3276,6 @@ dependencies = [
"num_enum",
"once_cell",
"p2p-repo",
"reqwest",
"serde",
"serde_bare",
"serde_bytes",
@ -3648,7 +3610,7 @@ dependencies = [
"libc",
"log",
"pin-project-lite",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -4000,12 +3962,10 @@ dependencies = [
"http",
"http-body",
"hyper",
"hyper-tls",
"ipnet",
"js-sys",
"log",
"mime",
"native-tls",
"once_cell",
"percent-encoding",
"pin-project-lite",
@ -4013,7 +3973,6 @@ dependencies = [
"serde_json",
"serde_urlencoded",
"tokio",
"tokio-native-tls",
"tokio-util",
"tower-service",
"url",
@ -4126,7 +4085,7 @@ dependencies = [
"io-lifetimes",
"libc",
"linux-raw-sys",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -4180,15 +4139,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "schannel"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
dependencies = [
"windows-sys 0.42.0",
]
[[package]]
name = "scoped-tls"
version = "1.0.1"
@ -4201,29 +4151,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "security-framework"
version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8"
dependencies = [
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "selectors"
version = "0.22.0"
@ -4993,7 +4920,7 @@ dependencies = [
"fastrand",
"redox_syscall 0.3.5",
"rustix",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -5138,7 +5065,7 @@ dependencies = [
"signal-hook-registry",
"socket2",
"tokio-macros",
"windows-sys 0.48.0",
"windows-sys",
]
[[package]]
@ -5152,16 +5079,6 @@ dependencies = [
"syn 2.0.18",
]
[[package]]
name = "tokio-native-tls"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [
"native-tls",
"tokio",
]
[[package]]
name = "tokio-stream"
version = "0.1.14"
@ -5901,21 +5818,6 @@ version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee78911e3f4ce32c1ad9d3c7b0bd95389662ad8d8f1a3155688fed70bd96e2b6"
[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-sys"
version = "0.48.0"

@ -25,7 +25,7 @@ noise-protocol = "0.2.0-rc1"
noise-rust-crypto = "0.6.0-rc.1"
ed25519-dalek = "1.0.1"
either = "1.8.1"
reqwest = { version = "0.11.18", features = ["json"] }
# reqwest = { version = "0.11.18", features = ["json"] }
#,"native-tls-vendored"
url = "2.4.0"
base64-url = "2.0.0"

@ -367,18 +367,18 @@ impl BrokerServerV0 {
)
}
BrokerServerTypeV0::BoxPublicDyn(addrs) => {
let resp = reqwest::get(api_dyn_peer_url(&self.peer_id)).await;
if resp.is_ok() {
let resp = resp.unwrap().json::<Vec<BindAddress>>().await;
if resp.is_ok() {
return Self::app_ng_one_bootstrap_url_with_first_ipv6_or_ipv4(
ipv4,
ipv6,
&resp.unwrap(),
self.peer_id,
);
}
}
// let resp = reqwest::get(api_dyn_peer_url(&self.peer_id)).await;
// if resp.is_ok() {
// let resp = resp.unwrap().json::<Vec<BindAddress>>().await;
// if resp.is_ok() {
// return Self::app_ng_one_bootstrap_url_with_first_ipv6_or_ipv4(
// ipv4,
// ipv6,
// &resp.unwrap(),
// self.peer_id,
// );
// }
// }
if addrs.len() > 0 {
Self::app_ng_one_bootstrap_url_with_first_ipv6_or_ipv4(
ipv4,
@ -436,13 +436,13 @@ impl BrokerServerV0 {
Some((APP_NG_ONE_WS_URL.to_string(), addrs.clone()))
}
BrokerServerTypeV0::BoxPublicDyn(addrs) => {
let resp = reqwest::get(api_dyn_peer_url(&self.peer_id)).await;
if resp.is_ok() {
let resp = resp.unwrap().json::<Vec<BindAddress>>().await;
if resp.is_ok() {
return Some((APP_NG_ONE_WS_URL.to_string(), resp.unwrap()));
}
}
// let resp = reqwest::get(api_dyn_peer_url(&self.peer_id)).await;
// if resp.is_ok() {
// let resp = resp.unwrap().json::<Vec<BindAddress>>().await;
// if resp.is_ok() {
// return Some((APP_NG_ONE_WS_URL.to_string(), resp.unwrap()));
// }
// }
if addrs.len() > 0 {
Some((APP_NG_ONE_WS_URL.to_string(), addrs.clone()))
} else {
@ -503,13 +503,13 @@ impl BrokerServerV0 {
BrokerServerTypeV0::BoxPrivate(addrs) => Some((String::new(), addrs.clone())),
BrokerServerTypeV0::BoxPublic(addrs) => Some((String::new(), addrs.clone())),
BrokerServerTypeV0::BoxPublicDyn(addrs) => {
let resp = reqwest::get(api_dyn_peer_url(&self.peer_id)).await;
if resp.is_ok() {
let resp = resp.unwrap().json::<Vec<BindAddress>>().await;
if resp.is_ok() {
return Some((String::new(), resp.unwrap()));
}
}
// let resp = reqwest::get(api_dyn_peer_url(&self.peer_id)).await;
// if resp.is_ok() {
// let resp = resp.unwrap().json::<Vec<BindAddress>>().await;
// if resp.is_ok() {
// return Some((String::new(), resp.unwrap()));
// }
// }
if addrs.len() > 0 {
Some((String::new(), addrs.clone()))
} else {

@ -116,13 +116,13 @@ pub fn check_is_local_url(bootstrap: &BrokerServerV0, location: &String) -> Opti
pub async fn retrieve_local_url(location: String) -> Option<String> {
let bootstraps: BootstrapContent = {
let resp = reqwest::get(format!("{}{}", APP_PREFIX, NG_BOOTSTRAP_LOCAL_PATH)).await;
if resp.is_ok() {
let resp = resp.unwrap().json::<BootstrapContent>().await;
resp.unwrap()
} else {
return None;
}
// let resp = reqwest::get(format!("{}{}", APP_PREFIX, NG_BOOTSTRAP_LOCAL_PATH)).await;
// if resp.is_ok() {
// let resp = resp.unwrap().json::<BootstrapContent>().await;
// resp.unwrap()
// } else {
return None;
// }
};
for bootstrap in bootstraps.servers() {
let res = check_is_local_url(bootstrap, &location);
@ -148,19 +148,19 @@ pub async fn retrieve_local_bootstrap(
log_debug!("invite_String {:?} invite1{:?}", invite_string, invite1);
let invite2: Option<Invitation> = {
let resp = reqwest::get(format!("{}{}", APP_PREFIX, NG_BOOTSTRAP_LOCAL_PATH)).await;
if resp.is_ok() {
let resp = resp.unwrap().json::<BootstrapContent>().await;
if resp.is_ok() {
let mut inv: Invitation = resp.unwrap().into();
inv.set_url(BROKER.read().await.get_registration_url());
Some(inv)
} else {
None
}
} else {
None
}
// let resp = reqwest::get(format!("{}{}", APP_PREFIX, NG_BOOTSTRAP_LOCAL_PATH)).await;
// if resp.is_ok() {
// let resp = resp.unwrap().json::<BootstrapContent>().await;
// if resp.is_ok() {
// let mut inv: Invitation = resp.unwrap().into();
// inv.set_url(BROKER.read().await.get_registration_url());
// Some(inv)
// } else {
// None
// }
// } else {
None
//}
};
let res = if invite1.is_none() {

Loading…
Cancel
Save