1345 Commits

Author SHA1 Message Date
Toralf Wittner
b5acf226f9
multistream-select: Include \n in length. (#439)
* multistream-select: Include `\n` in length.

* Add comment to explain the +1.

* Re-enable test.
2018-09-03 11:13:42 +02:00
Pierre Krieger
ccc5aacafc Fix #440 (#441)
* Fix #440

* Ignore failing test
2018-09-03 10:25:16 +02:00
Pierre Krieger
0e1483f02e Rework the StreamMuxer trait (#437)
* Stronger typing for the swarm handler future
* The swarm future is now a swarm stream of events
* Rewrite StreamMuxer in core
* Update libp2p_mplex for the new stream muxer
* Update yamux for new stream muxer
2018-08-31 10:31:34 +02:00
Toralf Wittner
c02dea8128
Introduce several concrete future types. (#433)
* multisteam-select: introduce `DialerFuture`.

* multistream-select: add more concrete futures.

* multistream-select: add ListenerFuture.

* multistream-select: add ListenerSelectFuture

* Formatting.

* Add DialerSelectFuture type alias.

* Add UpgradeApplyFuture and NegotiationFuture.

* In iterator wrappers also pass-through size_hint.

* Minor refactoring.

* Address review comments.

* Add some comments.

* Hide state enums in wrapping structs.
2018-08-30 23:25:16 +02:00
Toralf Wittner
f457ca5490
Correctly encode and decode multistream-select ls. (#438) 2018-08-30 23:13:06 +02:00
Eugene Chupriyanov
4798952e2f Fix rust-libp2p issue #429 (floodsub fails to decode PeerId) (#430) 2018-08-29 11:37:07 +02:00
Benjamin Kampmann
2ea49718f3
Clean up directory structure (#426)
* Remove unused circular-buffer crate
* Move transports into subdirectory
* Move misc into subdirectory
* Move stores into subdirectory
* Move multiplexers
* Move protocols
* Move libp2p top layer
* Fix Test: skip doctest if secio isn't enabled
2018-08-29 11:24:44 +02:00
Eugene Chupriyanov
f5ce93c730 Replaced tokio_time::Deadline with tokio::timer::Timeout (#432) 2018-08-28 15:38:08 +02:00
Pierre Krieger
c77b1f5a0a Better documentation (#391)
* Better documentation

* Minor
2018-08-22 10:46:23 +02:00
Pierre Krieger
7aa08917ea Simplify the implementation of peer_info (#327)
* Simplify the implementation of peer_info
* Add Serde-Support to MultiAddr
2018-08-20 12:04:22 +02:00
Pierre Krieger
6c7ae04349 Allow configuring mplex (#411) 2018-08-17 09:39:37 +02:00
Pierre Krieger
c6e28dcc45 Add Transport::map_err_dial (#392) 2018-08-15 17:42:34 +02:00
Pierre Krieger
6200055161 Add multiaddr! macro (#413) 2018-08-15 17:19:19 +02:00
cheme
5b712e559a Complements to #389 (#415)
* Copyright and test module

* Cosmetic changes

* Put back static constraint in mplex (in case it might be needed in other crates).

* 2018, Send on box.
2018-08-15 17:00:57 +02:00
Pierre Krieger
bd73f60358 Add some Send implementations to Futures (#412) 2018-08-14 15:23:30 +02:00
Jun Jiang
e5afab104a Fix compiling error on windows (#410)
* Fix compiling error on windows

* Fix JsonFileDatastore tests

* Update tempfile cargo, Refactor JsonFileDatastore tests
2018-08-14 11:31:05 +02:00
Pierre Krieger
b673209839 Fixes to the mplex implementation (#360)
* Fixes to the mplex implementation
* Fix mem leak and wrong logging message
* Correctly handle Close and Reset
* Check the even-ness of the substream id
2018-08-13 11:29:07 +02:00
cheme
73996885cb remove rustc-serialize (#359) (#386)
* Replace rust-crypto dependency by RustCrypto project crate aes-ctr

* Support for x86 build supporting both aesni and aessoft at runtime.
Feature gated behind 'aes-all'.
Building requires RUSTFLAGS="-C target-feature=+aes,+ssse3" and RUSTDOCFLAGS="-C target-feature=+aes,+ssse3".
Only support x86 case.

* Change CI to build with aes ni on all-features

* Switch aes-all logic (is_x86 runtime test did not work as I thought when
RUSTC aes and sse are enabled).
To build with aes-all, aes and sse flag should not be set.

* Use latest aesni from crates.io (with pr to disable compile time
checks).

* Replace rust-crypto dependency by RustCrypto project crate aes-ctr

* Support for x86 build supporting both aesni and aessoft at runtime.
Feature gated behind 'aes-all'.
Building requires RUSTFLAGS="-C target-feature=+aes,+ssse3" and RUSTDOCFLAGS="-C target-feature=+aes,+ssse3".
Only support x86 case.

* Change CI to build with aes ni on all-features

* Switch aes-all logic (is_x86 runtime test did not work as I thought when
RUSTC aes and sse are enabled).
To build with aes-all, aes and sse flag should not be set.

* Use latest aesni from crates.io (with pr to disable compile time
checks).
2018-08-10 18:27:20 +02:00
Pierre Krieger
d94fe1b831 Use a Multihash in AddrComponent::P2P, drop cid (#407)
* Use a Multihash in AddrComponent::P2P
* Remove the cid crate from the repo
2018-08-10 17:47:02 +02:00
Pierre Krieger
d4b98e8646 Add upgrade::loop_upg (#394) 2018-08-10 16:55:47 +02:00
Toralf Wittner
66db7f89b7 Externalise unsigned-varint crate. (#329) 2018-08-10 16:35:41 +02:00
Pierre Krieger
eb53ea2515
Add CircleCI build for win32 (#398)
* Add CircleCI build for win32

* Use cargo check instead

* Build for 32bits as well
2018-08-09 15:12:13 +02:00
Pierre Krieger
078fa1cb33
Rework the multihash crate (#403)
* Use Multihash and MultihashRef instead

* Don't use star imports

* Split EncodeError and DecodeError

* Add DecodeOwnedError

* Some cleanup

* Remove Hash::name()

* Some crate root documentation

* Add some more methods

* Fix tests

* Add PartialEq between Multihash and MultihashRef

* Fix the rest of the repo

* Rename hash_data() to digest()

* Add comment about varint

* Remove Error::description impls
2018-08-09 14:51:09 +02:00
Pierre Krieger
486a9694d9
Tcp refinements (#404)
* Improve nat_traversal

* Remove the Box for dialing

* Improve multiaddr_to_socketaddr

* Use ? on None

* Use a proper stream for TcpListenStream

* Rustfmt

* Use tk_listen for errors on the listener

* Minor changes

* Fix concerns
2018-08-09 14:04:15 +02:00
Pierre Krieger
5546bb9dfd
Use tk_listen to absorb errors on the TcpListener (#402)
* Use tk_listen to absorb errors on the TcpListener

* Put sleep_on_error in TcpConfig
2018-08-08 17:54:15 +02:00
Pierre Krieger
c3655226bb Add a UNIX transport (#308)
* Use the new version of tokio
* Add a UNIX transport
2018-08-08 12:38:29 +02:00
Pierre Krieger
ea881e3dfa Rework swarm and allow interrupting a dial (#366)
* Rework swarm and allow interrupting a dial
* Improve the UniqueConnec situation
* Remove UniqueConnec::get
* Rename `get_or_dial()` to `dial()` and add `dial_if_empty()`
* Clean the UniqueConnec is the future is dropped
* Rename `set_until` to `tie_or_stop` and add `tie_or_passthrough`
* Add some tests, docs
* Fix memory leak with tasks registration
* Interrupt dialing when a UniqueConnec is dropped or cleared
2018-08-08 12:00:38 +02:00
Pierre Krieger
e2618dc1b3
Add some From impls for AddrComponent (#395) 2018-08-07 19:57:57 +02:00
Qian LinFeng
d8d6a49dfe Fix decode data UnexpectedEof bug (#384) 2018-08-07 19:36:40 +02:00
Pierre Krieger
0348ac3534 Make ping unidirectional (#381) 2018-08-06 17:16:27 +02:00
Benjamin Kampmann
b573daa06d
Strongly type AddrComponent::{P2P, IPFS} with Cids (#357)
* Strongly type CID in AddrComponent::{IPFS, P2P}

* Reexport Cid, ToCid for convenience

* Fix Cid-typed P2P AddrComponents in dependencies
2018-08-06 17:04:49 +02:00
Pierre Krieger
1110907d78 Rewrite multiplex tests to use the memory transport (#370) 2018-08-06 10:41:11 +02:00
Pierre Krieger
9009a6ffa7 Fix peers() always returning empty results (#373) 2018-08-06 10:17:27 +02:00
Pierre Krieger
e14a5af8dd Update the P2P multiaddr component to 421 (#383) 2018-08-06 10:07:22 +02:00
Pierre Krieger
7d9836de7b Remove travis.yml (#382) 2018-08-06 09:54:37 +02:00
Pierre Krieger
c677980f91 Add Transport::map_err (#317)
* Add Transport::map_err
2018-07-31 10:43:41 +02:00
Pierre Krieger
ffe63ff987 Unify the versions of parking_lot (#380) 2018-07-30 16:06:03 +02:00
James Ray
9b233ba3ea Fix repeatedly spelling, more and more, add a clarification (#376)
Correct me if saying "close connections to non-responsive remotes (which would then de-allocate memory for the ping)" is wrong.
2018-07-27 10:46:45 +02:00
James Ray
3d6b1dbc3e Put comments in code and ie. -> i.e. (#375) 2018-07-27 10:10:14 +02:00
Toralf Wittner
81e8735968 Add memory transport. (#343)
* Add memory transport.

* Change test to be compatible with rust stable.

* Address concerns

* Add some documentation and minor fixes

* Move transport test to memory module
2018-07-25 13:44:27 +02:00
Pierre Krieger
e0d057a1a6
Add some logging when disconnecting a TCP stream (#352)
* Add some logging when disconnecting a TCP stream

* More logging
2018-07-21 13:01:59 +02:00
Pierre Krieger
9480295bf2
Add licenses to all Cargo.toml files (#349) 2018-07-21 12:15:42 +02:00
Toralf Wittner
9d28fa0b78 Skip over buckets older than ping_timeout. (#340)
Addresses issue #321.
2018-07-21 11:15:29 +02:00
Pierre Krieger
4db425d132
Fix potential panic in ping (#342) 2018-07-20 09:49:17 +02:00
Pierre Krieger
6acc0c7c5f
Add UniqueConnec::is_alive (#339) 2018-07-19 14:00:13 +02:00
Pierre Krieger
0cfaa23908
Add upgrade::map_with_addr (#331)
* Add upgrade::map_with_addr

* Some help for inferrence
2018-07-19 10:55:04 +02:00
Pierre Krieger
7507e0bfd9
Make the Pinger clonable (#330) 2018-07-18 18:47:58 +02:00
Toralf Wittner
bd169a5a4b Do not return peers with only expired addresses. (#325) 2018-07-18 14:37:01 +02:00
Toralf Wittner
cbc845d345 Always store open frames to internal buffer. (#319) 2018-07-18 12:35:37 +02:00
Toralf Wittner
b423e9fe8c
Use tokio-codec in mplex. (#315) 2018-07-18 10:30:56 +02:00