1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-23 05:35:58 +08:00

9382 Commits

Author SHA1 Message Date
1dede1b1d7 Merge pull request #5219 from schomatis/fix/mfs/remove-sort
mfs: remove `sort` from `ListNames()`
2018-07-19 14:29:11 -05:00
24832881dd fix shebang in check_go_path
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-19 09:01:32 -07:00
5ac752f1fb avoid realpath in check_go_path
It doesn't exist on all operating systems.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-18 19:05:48 -07:00
439b0e35dc fix check_go_path when it has spaces in it
fixes #5260

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-18 17:12:12 -07:00
6f140d2579 Merge pull request #5258 from ipfs/fix/5247
when sending blocks in bitswap, close streams asynchronously
2018-07-18 14:28:29 -05:00
256ad27099 Merge pull request #5218 from schomatis/fix/cmds-files-cp/err-msg
commands/files: add error messages for `cp` paths
2018-07-18 12:19:06 -05:00
a44bffba76 Merge pull request #5237 from schomatis/fix/unixfs/dag-reader/next-buf
unixfs: refactor `precalcNextBuf`
2018-07-18 12:17:12 -05:00
e8cc52966e Merge pull request #5216 from schomatis/fix/dag-modifier/preserve-fsnode
unixfs: fix `dagTruncate` to preserve node type
2018-07-18 12:01:40 -05:00
3e3065861d when sending blocks in bitswap, close streams asynchronously
Otherwise, we tie up the bitswap worker until the other side responds with an EOF.

fixes #5247
related to https://github.com/libp2p/go-libp2p-net/issues/28

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-18 09:56:25 -07:00
70d0f13c9c unixfs/mod: add test to Truncate to the same size
License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-18 13:14:34 -03:00
508af1e12c mfs: add test case for MFS repeated truncation failure
License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-18 13:14:32 -03:00
65a18ed669 unixfs: fix dagTruncate to preserve node type
Extract the original `FSNode` passed inside the `ipld.Node` argument and modify
its `Blocksizes` (removing all of them and re-adding the ones that were not
truncated). In contrast, the replaced code was creating a new `FSNode` that was
not preserving some of the features of the original one.

Change `TRUNC_HASH` values in `sharness` that were created with the bug to the
correct values.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-18 13:07:21 -03:00
454a170032 Merge pull request #5245 from ipfs/fix/5241
add trickle-dag support to the urlstore
2018-07-18 10:39:10 -05:00
d74ec0d9d4 Merge pull request #5253 from schomatis/fix/dag-truncate/same-size
fix truncating when already at the correct size
2018-07-18 10:38:50 -05:00
e6545a24b2 fix truncating when already at the correct size
fixes #4518

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-18 11:25:16 -03:00
9bad5fe6fe Merge pull request #4672 from ipfs/feat/coreapi-paths
Improve paths in CoreApi
2018-07-17 18:06:58 -05:00
4d5a96b0d6 coreapi: path rebase
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 09:00:50 +02:00
7adf1cb40d coreapi: move path utils to interface
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:44:54 +02:00
082498de6d coreapi: more docs for ResolvedPath
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
0adb69a773 coreapi: fix TestGatewayGet after rebase
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
0f6bd2d173 coreapi: fix resolved path root for some paths
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
e227fc3865 coreapi: fix ipns path resolving
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
604b187cca path: add tests for ipld paths
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
d5b5e0d7ac coreapi: add more docs for path
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
1d23bbeb0f coreapi: path review
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
9b288560a4 coreapi: path remainders
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
7ee6194352 coreapi: path.Mutable
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
f5f44ab246 coreapi: remove ctx from ParsePath, split ParseCid
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
15f8fc60c0 coreapi: separate path into two types
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:43:48 +02:00
4f6c0666ea coreapi: move path impl to path.go
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:42:06 +02:00
338e90e9c8 coreapi: expand public path api
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-07-17 08:40:48 +02:00
3218703f21 Merge pull request #5162 from ipfs/feat/improve-preload
always try to read ahead by at least 5 blocks in the PBDagReader
2018-07-16 23:43:14 -05:00
2dcb7f0985 Merge pull request #5246 from ipfs/gx/update-go-cid
update go-cid
2018-07-16 22:29:35 -05:00
9a9979b193 update go-cid
alternative to #5243 that updates go-cid and all packages that depend on it

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-16 15:16:49 -07:00
4d4f343df7 check hashes in urlstore sharness tests
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-16 15:04:46 -07:00
1358b28204 add sharness for trickle importer
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-16 15:04:45 -07:00
19caad2301 add trickle-dag support to the urlstore
fixes #5241

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-16 15:04:23 -07:00
89e1d9fd49 switch urlstore to the new commands lib
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-07-16 12:47:15 -07:00
0ab36f00bc Merge pull request #5118 from schomatis/feat/importer/remove-unixfsnode
importer: remove `UnixfsNode` from the balanced builder
2018-07-16 18:34:03 +02:00
13d9110088 unixfs: split precalcNextBuf
Create new `loadBufNode` function to handle the `buf` logic which is unrelated
to the main `precalcNextBuf` logic of processing promises to fetch nodes.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-16 13:33:45 -03:00
a1d207343a unixfs: refactor switch in precalcNextBuf
Do not use `NewDagReader` just for the `RawNode` case.
Treat invalid UnixFS types in the same case.

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-16 13:31:52 -03:00
474b77a2bd importer: remove UnixfsNode from the balanced builder
The `UnixfsNode` structure has multiple pointers to many (non-complementary)
mutually exclusive node types, only some of them are active (not-`nil`) at a
given time in the code path which made the code too convoluted. Specifically,
the most important distinction between node types was being hidden: leaf nodes
vs internal (non-leaf) nodes.

Remove entirely the use of `UnixfsNode` from the `balanced` package replacing it
in turn with the newly created `FSNodeOverDag` structure that represents the
UnixFS node encoded inside the DAG node, primarily used for internal node
representations. Leaf nodes are handled exclusively in the `NewLeafDataNode`
encapsulating its multiple representations (that we're previously exposed in
`UnixfsNode` as conflicting pointers).

The `builder.go` file has been completely rewritten, although the basic DAG
creation algorithm has been preserved (extending a full DAG by creating a new
root and linking the old one as its child), the most significant modification
has been in the loop of `Layout` that now only handles internal nodes (i.e.,
nodes with `depth` bigger than zero) to be able to adapt `fillNodeRec` to only
that scenario (avoiding the replace logic of the zero `depth` case with the
defective `Set` function, now removed). The `fillNodeRec` now explicitly returns
the `ipld.Node` and the size of the file data it's storing to propagate it
upwards into the DAG.

The `DagBuilderHelper` was heavily extended to incorporate `ipld.Node` functions
that would replace the `UnixfsNode` ones used by the balanced builder:
`NewLeafNode()`, `NewLeafDataNode()` and `AddNodeAndClose()`. Also, the
`ProcessFileStore` function was incorporated to encapsulate all the logic
related to the Filestore support which was scattered throughout the builder
logic, the `offset` that was being passed through most functions is now a part
of the `DagBuilderHelper`.

This has turned out to be a rather big commit, it should have been split into
more smaller and logically cohesive commits, but the `UnixfsNode` was too
entangled inside the logic and that would have required a progressive
modification of the `UnixfsNode` structure as well, which wasn't possible as it
is still being used by the balanced builder (the same reason why most of the
`UnixfsNode`-related functions cannot yet be removed, leaving the `helpers.go`
file mostly untouched).

License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-16 12:50:53 -03:00
0349d9de43 Merge pull request #5239 from schomatis/fix/unixfs/directory/type-accessor
unixfs: fix `FSNode` accessor in `NewDirectoryFromNode`
2018-07-16 17:42:58 +02:00
26feaeb0cc unixfs: fix FSNode accessor in NewDirectoryFromNode
License: MIT
Signed-off-by: Lucas Molas <schomatis@gmail.com>
2018-07-16 12:27:43 -03:00
419bfdc20f Merge pull request #4924 from ipfs/docs/config
Add information about bloom filter to config.md
2018-07-16 17:12:10 +02:00
b126601d80 Merge pull request #5160 from schomatis/feat/unixfs/dir-interface
unixfs: add a directory interface
2018-07-16 16:53:36 +02:00
8fa1c881f1 Merge pull request #5205 from spartucus/patch-1
Refactor code
2018-07-16 16:52:58 +02:00
bda81cd2d4 Merge pull request #5045 from schomatis/fix/cmd/files-ls-file-long
cmd: fix `files ls` to report hash and size for files
2018-07-16 16:52:13 +02:00
7927196fe4 version bump to 0.4.17-dev
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2018-07-16 07:51:26 -07:00
07feeec9c4 Merge pull request #5010 from ipfs/feat/diskusage2
Efficient "repo stat" (DiskUsage) and "--size-only" flag
2018-07-16 16:50:41 +02:00