Loading Cargo.lock +1 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ dependencies = [ name = "duniter-network" version = "0.1.0-a0.1" dependencies = [ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "duniter-crypto 0.2.0-a0.1", "duniter-documents 0.8.0-a0.1", "duniter-module 0.1.0-a0.1", Loading network/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ license = "AGPL-3.0" path = "lib.rs" [dependencies] byteorder = "1.2.3" duniter-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } duniter-module = { path = "../module" } Loading network/lib.rs +5 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ extern crate lazy_static; #[macro_use] extern crate serde_derive; extern crate byteorder; extern crate crypto; extern crate duniter_crypto; extern crate duniter_documents; Loading Loading @@ -337,8 +338,8 @@ mod tests { let node_id = NodeUUID(u32::from_str_radix("c1c39a0a", 16).unwrap()); let full_id = NodeFullId(node_id, issuer); assert_eq!( NetworkEndpoint::parse_from_raw("WS2P c1c39a0a i3.ifee.fr 80 /ws2p", issuer, 0, 0), Some(NetworkEndpoint::V1(NetworkEndpointV1 { NetworkEndpoint::parse_from_raw("WS2P c1c39a0a i3.ifee.fr 80 /ws2p", issuer, 0, 0, 1), Ok(NetworkEndpoint::V10(NetworkEndpointV10 { version: 1, issuer, api: NetworkEndpointApi(String::from("WS2P")), Loading @@ -363,8 +364,8 @@ mod tests { let node_id = NodeUUID(u32::from_str_radix("cb06a19b", 16).unwrap()); let full_id = NodeFullId(node_id, issuer); assert_eq!( NetworkEndpoint::parse_from_raw("WS2P cb06a19b g1.imirhil.fr 53012 /", issuer, 0, 0), Some(NetworkEndpoint::V1(NetworkEndpointV1 { NetworkEndpoint::parse_from_raw("WS2P cb06a19b g1.imirhil.fr 53012 /", issuer, 0, 0, 1), Ok(NetworkEndpoint::V10(NetworkEndpointV10 { version: 1, issuer, api: NetworkEndpointApi(String::from("WS2P")), Loading network/network_endpoint.rs +866 −49 File changed.Preview size limit exceeded, changes collapsed. Show changes ws2p/lib.rs +21 −5 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ impl Default for WS2PConf { ), 0, 0, 1u16, ).unwrap(), NetworkEndpoint::parse_from_raw( "WS2P b48824f0 g1.monnaielibreoccitanie.org 443 /ws2p", Loading @@ -114,6 +115,7 @@ impl Default for WS2PConf { ), 0, 0, 1u16, ).unwrap(), ], } Loading Loading @@ -536,7 +538,8 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { *node_full_id, *conn_state as u32, uid_option.clone(), ep.get_url(false), ep.get_url(false, false) .expect("Endpoint unreachable !"), ), ); } Loading Loading @@ -577,7 +580,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::Established as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::WSError(ws2p_full_id) => { Loading @@ -586,7 +592,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::WSError as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::NegociationTimeout(ws2p_full_id) => { Loading @@ -595,7 +604,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::Denial as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::Timeout(ws2p_full_id) => { Loading @@ -604,7 +616,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::Close as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::PeerCard(_ws2p_full_id, _peer_card, ws2p_endpoints) => { Loading Loading @@ -1062,6 +1077,7 @@ mod tests { ), 1, current_time.as_secs(), 1, ).expect("Failt to parse test endpoint !"); ws2p_db::write_endpoint(&db, &endpoint, 1, current_time.as_secs()); Loading Loading
Cargo.lock +1 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ dependencies = [ name = "duniter-network" version = "0.1.0-a0.1" dependencies = [ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "duniter-crypto 0.2.0-a0.1", "duniter-documents 0.8.0-a0.1", "duniter-module 0.1.0-a0.1", Loading
network/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ license = "AGPL-3.0" path = "lib.rs" [dependencies] byteorder = "1.2.3" duniter-crypto = { path = "../crypto" } duniter-documents = { path = "../documents" } duniter-module = { path = "../module" } Loading
network/lib.rs +5 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ extern crate lazy_static; #[macro_use] extern crate serde_derive; extern crate byteorder; extern crate crypto; extern crate duniter_crypto; extern crate duniter_documents; Loading Loading @@ -337,8 +338,8 @@ mod tests { let node_id = NodeUUID(u32::from_str_radix("c1c39a0a", 16).unwrap()); let full_id = NodeFullId(node_id, issuer); assert_eq!( NetworkEndpoint::parse_from_raw("WS2P c1c39a0a i3.ifee.fr 80 /ws2p", issuer, 0, 0), Some(NetworkEndpoint::V1(NetworkEndpointV1 { NetworkEndpoint::parse_from_raw("WS2P c1c39a0a i3.ifee.fr 80 /ws2p", issuer, 0, 0, 1), Ok(NetworkEndpoint::V10(NetworkEndpointV10 { version: 1, issuer, api: NetworkEndpointApi(String::from("WS2P")), Loading @@ -363,8 +364,8 @@ mod tests { let node_id = NodeUUID(u32::from_str_radix("cb06a19b", 16).unwrap()); let full_id = NodeFullId(node_id, issuer); assert_eq!( NetworkEndpoint::parse_from_raw("WS2P cb06a19b g1.imirhil.fr 53012 /", issuer, 0, 0), Some(NetworkEndpoint::V1(NetworkEndpointV1 { NetworkEndpoint::parse_from_raw("WS2P cb06a19b g1.imirhil.fr 53012 /", issuer, 0, 0, 1), Ok(NetworkEndpoint::V10(NetworkEndpointV10 { version: 1, issuer, api: NetworkEndpointApi(String::from("WS2P")), Loading
network/network_endpoint.rs +866 −49 File changed.Preview size limit exceeded, changes collapsed. Show changes
ws2p/lib.rs +21 −5 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ impl Default for WS2PConf { ), 0, 0, 1u16, ).unwrap(), NetworkEndpoint::parse_from_raw( "WS2P b48824f0 g1.monnaielibreoccitanie.org 443 /ws2p", Loading @@ -114,6 +115,7 @@ impl Default for WS2PConf { ), 0, 0, 1u16, ).unwrap(), ], } Loading Loading @@ -536,7 +538,8 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { *node_full_id, *conn_state as u32, uid_option.clone(), ep.get_url(false), ep.get_url(false, false) .expect("Endpoint unreachable !"), ), ); } Loading Loading @@ -577,7 +580,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::Established as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::WSError(ws2p_full_id) => { Loading @@ -586,7 +592,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::WSError as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::NegociationTimeout(ws2p_full_id) => { Loading @@ -595,7 +604,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::Denial as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::Timeout(ws2p_full_id) => { Loading @@ -604,7 +616,10 @@ impl DuniterModule<DuRsConf, DuniterMessage> for WS2PModule { ws2p_full_id, WS2PConnectionState::Close as u32, ws2p_module.uids_cache.get(&ws2p_full_id.1).cloned(), ws2p_module.ws2p_endpoints[&ws2p_full_id].0.get_url(false), ws2p_module.ws2p_endpoints[&ws2p_full_id] .0 .get_url(false, false) .expect("Endpoint unreachable !"), )); } WS2PSignal::PeerCard(_ws2p_full_id, _peer_card, ws2p_endpoints) => { Loading Loading @@ -1062,6 +1077,7 @@ mod tests { ), 1, current_time.as_secs(), 1, ).expect("Failt to parse test endpoint !"); ws2p_db::write_endpoint(&db, &endpoint, 1, current_time.as_secs()); Loading