2121 Commits

Author SHA1 Message Date
Pierre Krieger
21f32da045
Merge remote-tracking branch 'upstream/master' into HEAD 2019-12-12 14:10:01 +01:00
Pierre Krieger
1aeb264cbc
Merge pull request #1341 from kigawas/patch-1
Upgrade ed25519-dalek
2019-12-12 14:09:09 +01:00
Pierre Krieger
a7206014d1
Merge pull request #1342 from tomaka/cleanup-stable
Cleanups in libp2p-core in stable-futures branch
2019-12-12 13:39:43 +01:00
Pierre Krieger
1c59b99f28
Merge branch 'master' into patch-1 2019-12-12 13:38:42 +01:00
Pierre Krieger
92a95c0bf2
Merge pull request #1344 from olegnn/docs_and_code_fixes
Fixed link
2019-12-12 13:38:32 +01:00
Pierre Krieger
550fdce016
Merge branch 'master' into docs_and_code_fixes 2019-12-12 12:58:26 +01:00
Pierre Krieger
5237303f45
Merge pull request #1348 from tomaka/backport-1347
Backport #1347 to master
2019-12-12 12:58:14 +01:00
Pierre Krieger
168f5d857b
Merge pull request #1347 from tomaka/fix-noise-io-flush
Fix noise/io.rs not flushing the underlying stream
2019-12-12 12:46:21 +01:00
Pierre Krieger
5da38c866c
Merge branch 'master' into docs_and_code_fixes 2019-12-12 12:46:16 +01:00
Oleg Nosov
f6592df65d
Fixed link 2019-12-12 13:06:59 +03:00
Pierre Krieger
c0e78f2dfb
Merge pull request #1343 from tomaka/derive-poll-context
Pass &mut std::task::Context to poll
2019-12-11 17:44:00 +01:00
Pierre Krieger
d0032702f4
Update protocols/noise/src/io.rs
Co-Authored-By: Toralf Wittner <tw@dtex.org>
2019-12-11 17:42:24 +01:00
Pierre Krieger
073f073a77
Backport #1347 to master 2019-12-11 17:07:16 +01:00
Pierre Krieger
3f1cbaa3a8
Fix noise/io.rs not flushing the underlying stream 2019-12-11 17:02:32 +01:00
Pierre Krieger
08568a4696
Merge pull request #1346 from tomaka/patch-mselect
Publish multistream-select 0.6.1
2019-12-11 14:04:06 +01:00
Pierre Krieger
22c2a4f09b
Publish multistream-select 0.6.1 2019-12-11 13:04:17 +01:00
Pierre Krieger
18bcba94e7
Err, fix wrong foo functions 2019-12-10 17:22:40 +01:00
Pierre Krieger
213c633b92
Pass &mut std::task::Context to poll 2019-12-10 16:54:38 +01:00
Pierre Krieger
d738f4158f
More work 2019-12-10 13:40:40 +01:00
Pierre Krieger
ad42b00981
Cleanups in libp2p-core in stable-futures branch 2019-12-10 12:12:34 +01:00
Pierre Krieger
7e9175716e
Merge pull request #1340 from romanb/stable-futures-multistream-simpl
[stable-futures] Remove a write optimisation in Negotiated.
2019-12-10 11:29:10 +01:00
Pierre Krieger
7745bfd01f
Merge pull request #1338 from romanb/multistream-select-io-fix
Fix possible incorrect return value from <LengthDelimitedReader as io::Write>::write().
2019-12-10 11:29:05 +01:00
Weiliang Li
a8a0c4340a
Update Cargo.toml
upgrade ed25519-dalek
2019-12-10 13:37:23 +09:00
Roman S. Borschel
1e8a90c606 Remove a write optimisation in Negotiated. 2019-12-09 21:13:55 +01:00
Roman S. Borschel
e4f46aed06 Simplify and update test.
Remove the optimisation of writing data out together with any
remaining buffer for simplicity.
2019-12-09 17:51:55 +01:00
Pierre Krieger
a5415f9e1d
Merge pull request #1339 from tomaka/ignore-kad-fail
Make the kademlia test ignore failures
2019-12-09 17:13:09 +01:00
Pierre Krieger
26ec67b0a9
Make the kademlia test ignore failures 2019-12-09 16:50:08 +01:00
Toralf Wittner
481849e4f1
secio: Back to 4-byte BE length prefix. (#1337)
The secio spec states that each frame must be prefix with a 32-bit big
endian length prefix so we can not use an unsigned varint here.
2019-12-09 16:34:13 +01:00
Roman S. Borschel
3de85ba4e2 Fix possible incorrect return value from LengthDelimitedReader::write().
Due to not taking into account buf.len() when computing `written`,
it may be incorrectly less than buf.len().
2019-12-09 15:50:35 +01:00
Pierre Krieger
b6d5d97261
Merge pull request #1336 from tomaka/fix-stable-fut-tests
Fix the regular tests for stable-futures
2019-12-09 12:06:15 +01:00
Pierre Krieger
73e745ec2b
Fix the regular tests for stable-futures 2019-12-09 11:41:31 +01:00
Pierre Krieger
ea58aed37e
Merge pull request #1335 from twittner/tests
Fix remaining tests.
2019-12-09 11:37:37 +01:00
Toralf Wittner
173fc04b30 Fix tests. 2019-12-07 15:11:46 +01:00
Toralf Wittner
9cefb52b1f
Update to current soketto develop. (#1332) 2019-12-06 15:54:15 +01:00
Pierre Krieger
fb997f24da
Merge pull request #1327 from tomaka/merge-master-for-real
Merge master for real
2019-11-29 17:54:21 +01:00
Pierre Krieger
a6bef386bf
Merge remote-tracking branch 'upstream/master' into HEAD 2019-11-29 13:46:48 +01:00
Pierre Krieger
aa4c2898cb
Fix identify not compiling for wasm (#1326) 2019-11-29 13:42:46 +01:00
Pierre Krieger
98dac8d509
Merge master into stable-futures (#1325)
* Update parking_lot to v0.9 (#1300)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Publish 0.13.1 (#1304)

* Publish 0.13.1

* Update CHANGELOG.md

Co-Authored-By: Toralf Wittner <tw@dtex.org>

* Update some deps of core-derive (#1299)

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2019-11-28 18:03:59 +01:00
Max Inden
26f58d20a8
protocols/kad: Fix tests + minor fix in mdns and noise (#1320)
* misc/mdns: Fix missleading error message

* protocols/noise: Remove unneeded tokio-io import

* protocols/kad: Update tests to use stable futures
2019-11-28 16:12:02 +01:00
Toralf Wittner
8d22e98abc
Add support for PINGs and PONGs to websockets. (#1319)
* Add support for PINGs and PONGs to websockets.

`Connection` (formerly `BytesConnection`) now supports more structured
`IncomingData` and `OutgoingData` which mirror the data types in
soketto (which are not exposed). This allows adding `Connection::ping`
and `Connection::pong` methods.

The non-framed websocket transport defines `BytesConnection` as a
wrapper around `Connection` and handles only binary data.
2019-11-26 17:37:45 +01:00
Pierre Krieger
8be45f5318 Fix the identify tests (#1324)
* Fix identify tests

* Some clean-up
2019-11-26 14:47:49 +01:00
Pierre Krieger
e5b087d01f
Fix the WASM build with stable futures (#1322)
* Fix the WASM build with stable futures

* Fix duplicate dependencies error
2019-11-26 11:48:47 +01:00
Pierre Krieger
e083e82212 Fix tests of libp2p-ping (#1321) 2019-11-25 17:33:59 +01:00
Toralf Wittner
b7644722ee
Fix examples and update core-derive. (#1317) 2019-11-25 10:45:04 +01:00
Toralf Wittner
df71d4a861
Update root crate to use futures-0.3. (#1315)
Mostly mechanical. Creating a `CommonTransport` yields an
`io::Result<_>` now since creating the `DnsConfig` may fail with an
`io::Error` when creating the `ThreadPool`.

The `DnsConfig` `Transport` impl had to be changed slightly:

(a) PR [[1311]] requires some `Send` bounds.
(b) The async block had to be changed to work around lifetime inference
issues which resulted in an "one type is more general than the other"
error.

[1311]: https://github.com/libp2p/rust-libp2p/pull/1311
2019-11-22 14:30:21 +01:00
Toralf Wittner
1597b026cb
Use soketto's reader-writer-split branch. (#1311) 2019-11-22 14:29:52 +01:00
Pierre Krieger
7cd44ae3de
Fix mplex tests (#1314) 2019-11-21 16:14:27 +01:00
Toralf Wittner
812889102c
Update mdns dependencies to use futures-0.3 (#1313) 2019-11-20 18:26:21 +01:00
Max Inden
a26620bf39 misc/mdns: Update to futures-preview (#1247)
* misc/mdns/service: Use async std with stack pinned futures

* misc/mdns: Define mdns broadcast address as lazy static

* misc/mdns: Drop future before borrowing their arguments again

* misc/mdns: Send queries on query socket, not socket

* misc/mdns: Use poll_next_unpin on query interval stream

* misc/mdns: Ensure underlying task is woken up on next interval tick

* misc/mdns: Wrap match expression in scope to drop future early

* misc/mdns: Adjust 'discovery_ourselves' test

* misc/mdns: Make query interval fire instantly on first tick

This is an optimization only important for short lived use cases, e.g.
unit tests. Instead of waiting for 20 seconds at first, the query
interval fires right away and thereby the service makes progress
instantly.

* misc/mdns: Adjust MdnsService documentation tests

* misc/mdns: Do not drop UDP socket send and reicv futures

Libp2p-mdns uses the async-std crate for network io. This crate only
offers async send and receive functions. In order to use this in non
async/await functions one needs to keep the future returned by the crate
functions around across `poll` invocations.

The future returned by the crate functions references the io resource.
Thus one has to keep both the io resource as well as the future
referencing it. This results in a self-referencing struct which is not
possible to create with safe Rust.

Instead, by having `MdnsService::next` (former `MdnsService::poll`) take
ownership of `self`, the Rust async magic takes care of the above (See
code comments for more details).

As a (negative) side effect, given that `MdnsService::next` takes
ownership of `self`, there is nothing to bind the lifetime of the
returned `MdnsPacket` to. With no better solution in mind, this patch
makes `MdnsPacket` static, not referencing the `MdnsService` receive
buffer.

* misc/mdns: Fix code comments and remove *if Free* TODO

* misc/mdns: Minor refactorings

* misc/mdns: Build responses in behaviour.rs directly

* misc/mdns: Move response ttl duration to constant

* misc/mdns: Remove optimization todo comment

* misc/mdns: Add query interval test

* misc/mdns: Move packet parsing into MdnPacket impl

* misc/mdns: Don't have receiving packets starve the query interval

When we 'await' on receiving a packet on the udp socket without
receiving a single packet we starve the remaining logic of the mdns
service, in this case the logic triggered on the receive interval.

* misc/mdns: Add debug_assert to MaybeBusyMdnsService check

* misc/mdns: Implement Debug for MaybeBusyMdnsService

* misc/mdns: Make ownership note a normal comment, not a doc comment

* misc/mdns: Have discovered_peers return an iterator
2019-11-20 13:25:12 +01:00
Qinxuan Chen
88c2287e44 Update some deps of core-derive (#1299)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2019-11-19 17:25:58 +01:00