17 Commits

Author SHA1 Message Date
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
Toralf Wittner
66db7f89b7 Externalise unsigned-varint crate. (#329) 2018-08-10 16:35:41 +02:00
Pierre Krieger
ffe63ff987 Unify the versions of parking_lot (#380) 2018-07-30 16:06:03 +02:00
Pierre Krieger
9480295bf2
Add licenses to all Cargo.toml files (#349) 2018-07-21 12:15:42 +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
Pierre Krieger
294310cd07
Rewrite multiplex (#261)
* Rewrite multiplex

* Increase the packet size limit to 32 MB

* Fix waiting for poll_complete to finish

* Typo

* Properly close substreams

* Add a limit to the number of substreams

* Add a limit to the length of the internal buffer

* Fix concerns
2018-07-17 16:31:32 +02:00
Pierre Krieger
16e3453b7f
Use the new version of tokio (#303) 2018-07-16 12:15:27 +02:00
Pierre Krieger
7b375798a5
The Multiaddr of the remote is now a Future (#249)
* The Multiaddr of the remote is now a Future

* The multiaddress future in swarm is now a Box
2018-06-19 14:38:55 +02:00
Toralf Wittner
15540a34c2
Add missing check for read of 0 bytes. (#194)
Forgot this one in PR #178.
2018-05-17 15:29:27 +02:00
Toralf Wittner
86a21fc43e
Remove all targets from log statements. (#195)
The default uses crate + module path anyway, so `target` has been
redundant, causes more work when renaming crates and makes log
lines longer.
2018-05-17 15:14:13 +02:00
Pierre Krieger
5c1890e66a
Rename libp2p_swarm to libp2p_core (#189) 2018-05-16 12:59:36 +02:00
Pierre Krieger
f787f3d8b8
Swarm rework (#182)
* Rename Transport::RawConn to Output

* Remove AsyncRead + AsyncWrite bound on Transport::Output

* UpgradedNode now always implements Transport

* Add and tweak modifiers for Transport and ConnectionUpgrade

* Secio upgrade now returns the pubkey in its output

* Add upgrade::apply

* Add Transport::and_then

* Rework the swarm

* Rustfmt

* Fix concerns
2018-05-14 15:55:16 +02:00
Toralf Wittner
4382adcbde connection_reuse: drop dead connections. (#178)
Currently, connection substreams are added to
`connection_reuse::Shared::active_connections`, but never removed. This
is not least because the `StreamMuxer` trait defines its inbound and
outbound substream futures to always yield a substream and contains no
provision to signal that no more substreams can be created, which would
allow client code (e.g. `ConnectionReuse`) to detect this and purge its
caches.

This PR defines the `StreamMuxer` trait to optionally yield
inbound/outbound substreams and changes `libp2p-mplex` to handle
stream EOFs by marking the underlying resource as closed.
`ConnectionReuse` will remove stream muxers from its active connections
cache if a `None` substream is returned.
2018-05-14 14:49:29 +02:00
Toralf Wittner
773cf6c26d Add log statements to libp2p-mplex. (#179)
* Add log statements to libp2p-mplex.

Addresses issue #126.

* Run `cargo fmt`.

* Wording.

* Adjust log levels.
2018-05-08 19:20:57 +02:00
Pierre Krieger
fd0d75f61e
Remove rustc-serialize (#176) 2018-05-06 17:41:06 +02:00
Pierre Krieger
9a7c278e83
Rename multiplex to libp2p-mplex (#153)
* Rename multiplex to libp2p-multiplex

* Rename multiplex to mplex

* Fmt

* Fix compilation
2018-05-04 15:27:49 +02:00