19 Commits

Author SHA1 Message Date
Max Inden
e3af8b7d03
*: Apply clippy suggestions and enable clippy on CI (#1850)
* *: Apply clippy suggestions

* .github: Add clippy check

* protocols/kad/record: Implement custom PartialEq for ProviderRecord
2020-11-24 15:59:22 +01:00
Volker Mische
3f38c1c8bb
feat: upgrade multihash (#1792)
* feat: upgrade to multihash 0.13

`multihash` changes a lot internally, it is using stack allocation instead
of heap allocation. This leads to a few limitations in regards on how
`Multihash` can be used.

Therefore `PeerId` is now using a `Bytes` internally so that only minimal
changes are needed.

* Update versions and changelogs.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
Co-authored-by: Roman S. Borschel <roman@parity.io>
2020-11-17 11:15:20 +01:00
Mikhail Zabaluev
82156deac5
Support /dns protocol in multiaddr (#1575)
* Add /dns protocol support to multiaddr

The /dns protocol has been added to the spec and has had a de-facto
meaning for years.
See https://github.com/multiformats/multiaddr/pull/100

This adds address parsing and encoding support for /dns to the multiaddr
format library.

* Cover Dns protocol in multiaddr property tests

* transports/dns: Support the /dns protocol

* Support /dns protocol in address translation

* Translate an FQDN URL into a /dns multiaddr

* transports/websocket: Support /dns multiaddr

* Use the /dns protocol in websocket redirects

The whole thing with back-translating from an redirect URL looks a bit
baroque, but at least now the transport does not completely ignore IPv6
addresses resolved from a hostname in a redirect URL.

* Add CHANGELOG entry

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-18 10:21:55 +02:00
Akihito Nakano
69852a580b
Add dnsaddr (#1356)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-02-06 13:54:50 +01:00
Stan Bondi
955b60796a
Added Onion3 support to multiaddr (#1354) 2020-02-04 13:40:57 +01:00
Akihito Nakano
d83619109b Add protocol string to Error::UnknownProtocolString (#1355)
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-01-07 12:36:37 +01:00
Bill Farner
084c7d0046 Upgrade url and percent-encoding deps to 2.1.0 (#1267)
* Upgrade percent-encoding dep to 2.1.0

* Upgrade url dep to 2.1.0
2019-10-07 11:34:35 +02:00
Pierre Krieger
e7ab8eb1c3
Allow a path for WS multiaddresses (#1093)
* Allow a path for WS multiaddresses

* Fix tests

* Finish

* Tests

* Don't accept any path other than /
2019-05-24 14:12:44 +02:00
Pierre Krieger
43e4d1f589
Rewrite the MemoryTransport to be similar to the TcpConfig (#951)
* Rewrite the MemoryTransport to be similar to the TcpConfig

* Add small test

* Test and bug fixes
2019-02-18 17:05:50 +01:00
Roman Borschel
eeed66707b Address edition-2018 idioms. (#929) 2019-02-11 14:58:15 +01:00
Dan Robertson
fe4fc8c363 Move final crates to 2018 edition (#886) 2019-01-29 11:02:29 +01:00
Toralf Wittner
69eafd9869 multiaddr: change UDP constant from 17 to 273. (#714)
Fixes #692
2018-11-30 21:10:49 +01:00
Pierre Krieger
6a7c722ffc Add From<IpAddr> for Multiaddr (#623) 2018-11-12 10:44:18 +01:00
Toralf Wittner
276bc9c07a
multiaddr: explain the use of &str for Unix. (#543)
multiaddr: explain the use of `&str` for `Unix`.

Closes #408.
2018-10-08 14:51:24 +02:00
Toralf Wittner
e05422c05f multiaddr: add support for onion protocol. (#542)
* multiaddr: add support for onion protocol.

* Comment `read_onion`.

* Split onion into address and port parts.
2018-10-08 11:13:00 +02:00
Toralf Wittner
b61d9faece
multiaddr: future-proof error type (#506) 2018-09-21 10:39:36 +02:00
Toralf Wittner
84b089cacc
Refactor multiaddr crate. (#498)
Refactor multiaddr crate.

- Remove `AddrComponent`. Instead `Protocol` directly contains its
associated data.

- Various smaller changes around conversions to Multiaddr from other
types, e.g. socket addresses.

- Expand tests to include property tests which test encoding/decoding
identity.
2018-09-20 19:51:00 +02:00
Toralf Wittner
b2756c8fa9
Make Multiaddr::iter borrow data (#478)
* Use `unsigned-varint` crate.

* Implement `Display` for `Protocol`.

Gives `ToString` for free.

* Use `Cow` in `AddrComponent`.

* Add `AddrComponent::acquire`.

* Document `AddrComponent::acquire`.
2018-09-14 10:21:14 +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