Commit Graph

232 Commits

Author SHA1 Message Date
bors[bot]
aaf72c9ed4
Merge #110
110: add: p2p suffixes to multiaddrs from identify r=koivunej a=koivunej

not verified but indirectly used by the conformance tests when dialing a peer with an expected peerid.

Not 100% sure if this should be done, at least long as #105 is done at least to accept the multiaddrs with `/p2p/`.

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-17 09:56:40 +00:00
ljedrz
7e1047f517 docs: note about the P2p protocol suffix returned by Ipfs::identity
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-17 10:43:00 +02:00
ljedrz
a02eedf10b refactor: remove append_p2p in /id
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-17 10:36:36 +02:00
ljedrz
993b80d2d1 fix: disallow Multiaddrs without the P2p protocol
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-14 16:19:56 +02:00
bors[bot]
d2760bb4d5
Merge #294
294: Remove Walker indirection r=koivunej a=c410-f3r

Fixes #200.

By using mutable references instead of taking ownership, the following is now possible:

```rust
ContinuedWalk::Symlink(bytes, _, path, metadata) => {
  ...
}

// Instead of

ContinuedWalk::Symlink(bytes, item) => {
  if let Entry::Metadata(metadata_entry) = item.as_entry() {
    ...
  }
}
```

Co-authored-by: Caio <c410.f3r@gmail.com>
Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
2020-08-14 11:36:11 +00:00
Joonas Koivunen
3f743f2774 chore: cargo fmt 2020-08-14 11:01:58 +02:00
Joonas Koivunen
0a5c730477 add: p2p suffixes to multiaddrs from identify
not verified but indirectly used by the conformance tests when dialing a
peer with an expected peerid.
2020-08-14 11:01:58 +02:00
ljedrz
4154980dbe chore: remove a stray old libipld dep
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 18:08:48 +02:00
ljedrz
c930f651fd test: make async tests use only 1 thread
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:16:20 +02:00
ljedrz
4001e01a44 refactor: remove unused tokio features
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:47 +02:00
ljedrz
9e26bffbba chore: cargo clippy
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:47 +02:00
Caio
457cd428fa Remove inconsistent variants 2020-08-13 10:24:35 -03:00
ljedrz
cc12650d17 feat: allow connecting using /Multiaddr/p2p/PeerId addresses
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-12 12:04:15 +02:00
ljedrz
a9712ef740 chore: put Rust-IPFS contributors as authors
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-11 15:14:43 +02:00
ljedrz
b1bc672559 chore: merge and adapt the libipld dependency
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-10 13:15:11 +02:00
ljedrz
f8674a0504 refactor: remove the generic from IpfsOptions, RepoOptions and SwarmOptions
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-10 11:49:43 +02:00
Joonas Koivunen
aaabc37562 doc: suggestions and notes from code review
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-08-10 12:04:03 +03:00
Joonas Koivunen
665c0c4f85 doc: comment touch ups 2020-08-10 09:23:11 +03:00
Joonas Koivunen
bfc1bf167c refactor: rename put_file => put_link 2020-08-10 09:22:58 +03:00
Caio
09f44d18f2 Use mutable ref instead of taking ownership
Walker was being moved for each iteration and this was being a problem
for proper `Entry` matching.

Removes `Item` indirection and `continue_walk(self, ...)` is now
`inspect(&mut self, ...)`.
2020-08-09 13:52:14 -03:00
Joonas Koivunen
07c41c0573 fix: tests after going from Infallible => Rejection
the change was made to allow boxing the v0::routes return value.
2020-08-07 21:15:48 +03:00
Joonas Koivunen
a3f27e5b46 fix: move all path matching to v0, box handlers
This patch changes the warp filter boxing strategy so, that:

 1. paths are nested with a "prefix" matcher, if possible
 2. the actual handler for the matched path is boxed
 3. the non implemented but recognized paths are unified

This strategy might be a good compromise between optimizations and
compilation time but such measurements are yet to be done.

Previous boxing strategy ended up being quite unfortunate. Upon adding
the full `/add` implementation, the test cases using GNU binutils linker
or ld 2.33 (ubuntu) started failing failing with a thread overflowing
its stack.

Most of the stack frames were warp filters for matching the path. This
happened because the combine! macro used in http/src/v0.rs boxed
(mostly) each filter, meaning the compiler could never see through any
of the and requiring enough many frames at runtime to cause a stack
overflow.

An alternative of opt-level = 1 turned out to be easy and simple and was
explored in #293 while this solution was being searched for. The
downside is increased compilation time.
2020-08-07 21:07:11 +03:00
Joonas Koivunen
e38c1ff04c refactor: try splitting the huge func 2020-08-07 15:06:55 +03:00
Joonas Koivunen
fdc5f8aa84 refactor: make PostOrderIterator 'static
kind of forgot the String and Vec<u8> while trying to impl the Iterator
trait to return non-static values.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
5d8b124367 doc: suggestions from code review
Thanks to ljedrz for the many many fixes.

Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-08-07 15:06:55 +03:00
Joonas Koivunen
dc2c0217b9 feat: /add?progress=true
adds the progress reporting, which is a progress notification to the
response stream on every block write *in addition to* a notification
*after* the file has been read (order with the `Added` message doesn't
seem to have been specified).
2020-08-07 15:06:55 +03:00
Joonas Koivunen
5534fef2b8 refactor: wrap_in_directory => wrap_with_directory
just aligning the terminology and trying not to invent new terms.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
14112c3dca feat: /add?wrap_with_directory=true
previous implementation included "defaulting the name for the wrapper
dir" which was extra and not expected by the interface tests.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
65acedae1d fix: normalize prefix slash away to enable more tests 2020-08-07 15:06:55 +03:00
Joonas Koivunen
4077de1a0f fix: report adderrors so that js-ipfs-http-client errors
the mechanism is to just push a new line of MessageResponse. it's a
hack, but at least the js-ipfs-http-client fails.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
57737b49c6 refactor: detupleify into (Owned)?TreeNode 2020-08-07 15:06:55 +03:00
Joonas Koivunen
548dbe2873 chore: appease clippy
single while let Some(_) = ... changed to is_some().
2020-08-07 15:06:55 +03:00
Joonas Koivunen
bb9555b14e doc: explain anyhow dependency 2020-08-07 15:06:55 +03:00
Joonas Koivunen
f0bb5b41fd feat: create empty directories without metadata
this is the go-ipfs 0.5 level support for add and directories. next up
will be parsing the headers as unixfsv1.5 metadata and using those with
the directories *and* files.
2020-08-07 15:06:55 +03:00
Joonas Koivunen
ccd6bbe248 feat: build directory trees on /add 2020-08-07 15:06:53 +03:00
Joonas Koivunen
c59a4cbe22 refactor: try make /add streaming 2020-08-07 15:05:05 +03:00
ljedrz
d2016f0193 fix: use tokio::test in http instead of its async_std counterpart
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-07 09:27:15 +02:00
bors[bot]
b99288b7b1
Merge #290
290: Some maintenance r=koivunej a=ljedrz

Some maintenance work so as not to conflict too much with the pending PRs:
- depend on cid instead of libipld where only Cid is used
- update the `domain` dep (big `Cargo.lock` wins)

cc #75 

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-08-06 13:23:45 +00:00
ljedrz
f5f6790062 chore: depend on cid instead of libipld where only Cid is used
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-06 11:38:27 +02:00
Joonas Koivunen
5b6b5ddb1b fix: update async-stream to 0.3
this uses the rust 1.45 features to remove recursion inside the macro.
great for #284 which adds even more complicated async-stream(s).
2020-08-06 11:10:07 +03:00
Caio
94d9b0a358 Future-proof unused dependencies 2020-08-01 13:44:27 -03:00
Caio
d3bd3f649f Use default-features = false where applicable 2020-08-01 13:29:48 -03:00
bors[bot]
c6b68cc0fa
Merge #272
272: Split Entry into two different enums to remove unnecessary expects r=koivunej a=c410-f3r

Second take on #200 

`Entry` is now composed of `Bucket(...)` and `Metadata(MetadataEntry { ... })` to separate things that have and doesn't have metadata, which avoids returning optional values derived from a single entry-point.

Next PR will address the newly introduced double matching while iterating over `continue_walk` but it will require deeper logical changes.

Co-authored-by: Caio <c410.f3r@gmail.com>
2020-07-31 12:39:16 +00:00
Caio
1f8cd25fd9 Split Entry into two different enums 2020-07-31 08:39:47 -03:00
ljedrz
e820e7a5e8 feat: keep a node's Span instead of its name
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 17:32:25 +02:00
ljedrz
0abe1b4aa4 refactor: improve node init in some tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 15:59:14 +02:00
ljedrz
0140c673b8 feat: attach tracing to nodes
Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 14:53:38 +02:00
ljedrz
a284c1f841 feat: replace log with tracing
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-29 14:50:00 +02:00
ljedrz
3b6ad52d85 chore: update remaining deps
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-28 13:44:45 +02:00
bors[bot]
f60ac1a8c2
Merge #267
267: ci: use vcpkg for openssl on windows r=ljedrz a=koivunej

Hoping to find something to help with #261:
 - switch to using [lukka/run-vcpkg](https://github.com/lukka/run-vcpkg)
 - get rid of the llvm dependency on windows (it was not needed)
 - update openssl dep to 0.10.30

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
2020-07-28 10:50:00 +00:00