mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 08:51:57 +00:00
Rework libp2p-identify (#116)
* Add a proper PeerId to Peerstore * Turn identify into a transport layer * Expose the dialed multiaddress * Add identified nodes to the peerstore * Allow configuring the TTL of the addresses * Split identify in two modules * Some comments and tweaks * Run rustfmt * Add test and bugfix * Fix wrong address reported when dialing * Fix websocket browser code * Support the p2p protocol in libp2p-identify * Fix concerns * Fix libp2p-dns * More concerns
This commit is contained in:
@@ -53,7 +53,7 @@ fn client_to_server_outbound() {
|
||||
let future = listener
|
||||
.into_future()
|
||||
.map_err(|(err, _)| err)
|
||||
.and_then(|(client, _)| client.unwrap().0)
|
||||
.and_then(|(client, _)| client.unwrap().map(|v| v.0))
|
||||
.and_then(|client| client.outbound())
|
||||
.map(|client| Framed::<_, bytes::BytesMut>::new(client))
|
||||
.and_then(|client| {
|
||||
@@ -75,7 +75,7 @@ fn client_to_server_outbound() {
|
||||
.with_upgrade(multiplex::MultiplexConfig);
|
||||
|
||||
let future = transport.dial(rx.recv().unwrap()).unwrap()
|
||||
.and_then(|client| client.inbound())
|
||||
.and_then(|client| client.0.inbound())
|
||||
.map(|server| Framed::<_, bytes::BytesMut>::new(server))
|
||||
.and_then(|server| server.send("hello world".into()))
|
||||
.map(|_| ());
|
||||
@@ -102,7 +102,7 @@ fn client_to_server_inbound() {
|
||||
let future = listener
|
||||
.into_future()
|
||||
.map_err(|(err, _)| err)
|
||||
.and_then(|(client, _)| client.unwrap().0)
|
||||
.and_then(|(client, _)| client.unwrap().map(|v| v.0))
|
||||
.and_then(|client| client.inbound())
|
||||
.map(|client| Framed::<_, bytes::BytesMut>::new(client))
|
||||
.and_then(|client| {
|
||||
@@ -124,7 +124,7 @@ fn client_to_server_inbound() {
|
||||
.with_upgrade(multiplex::MultiplexConfig);
|
||||
|
||||
let future = transport.dial(rx.recv().unwrap()).unwrap()
|
||||
.and_then(|client| client.outbound())
|
||||
.and_then(|(client, _)| client.outbound())
|
||||
.map(|server| Framed::<_, bytes::BytesMut>::new(server))
|
||||
.and_then(|server| server.send("hello world".into()))
|
||||
.map(|_| ());
|
||||
|
Reference in New Issue
Block a user