Commit Graph

4209 Commits

Author SHA1 Message Date
Jeromy
c273a3bd4f better bitswap logging 2015-05-21 03:08:32 -04:00
Jeromy
2882c793e2 add a distribution test with the rebroadcast delay disabled 2015-05-21 03:08:32 -04:00
Juan Batiz-Benet
2eac921e1d fixup the bitswap readme 2015-05-21 03:08:32 -04:00
Jeromy
829b88420e explicitly set bitswap message fullness 2015-05-21 03:08:31 -04:00
Jeromy
594c7786c3 turn rebroadcast back on 2015-05-21 03:08:31 -04:00
Jeromy
6ab4bfea95 turn tests down a bit and better context passing 2015-05-21 03:08:31 -04:00
Jeromy
65f815a27b move taskdone inside lock boundaries 2015-05-21 03:08:31 -04:00
Jeromy
32da687774 fix race bugs 2015-05-21 03:08:31 -04:00
Jeromy
6bf33ad62f WIP: super awesome bitswap cleanup fixtime 2015-05-21 03:08:31 -04:00
Jeromy
ef967ceeef contextify peermanager 2015-05-21 03:08:31 -04:00
Jeromy
8443b99c1d update comments and reintroduce test 2015-05-21 03:08:31 -04:00
Jeromy
a159e6825c implement peermanager to control outgoing messages
Also more refactoring of bitswap in general, including some perf
improvements and eventlog removal.

clean up, and buffer channels

move some things around

correctly buffer work messages

more cleanup, and improve test perf

remove unneccessary test

revert changes to bitswap message, they werent necessary
2015-05-21 03:08:30 -04:00
Juan Batiz-Benet
f0276dc39d Merge pull request #1271 from ipfs/fix/shutdown-err
silence error log on shutdown
2015-05-21 02:53:32 -04:00
Jeromy
bd30866c1b silence error log on shutdown 2015-05-20 23:29:19 -07:00
Juan Batiz-Benet
ba82328dd9 Merge pull request #1270 from ipfs/fix/daemon-shutdown
do http server properly so daemon can shut down
2015-05-21 02:16:10 -04:00
Jeromy
f6fadc4c91 do http server properly so daemon can shut down 2015-05-20 22:42:54 -07:00
Juan Batiz-Benet
1f8230c98f Merge pull request #1263 from ipfs/stdin-parsing-optional-arg
Stdin parsing optional arg
2015-05-21 01:30:54 -04:00
Juan Batiz-Benet
5c94a68abb travis: dont run 1.3 for now
travis is very slow atm, so we're not running 1.3 builds for
a while.
2015-05-21 00:00:23 -04:00
Juan Batiz-Benet
12d38569a8 Merge pull request #1262 from ipfs/remove-inflect
remove inflect package
2015-05-20 23:59:30 -04:00
Juan Batiz-Benet
9b4b2c6879 Merge pull request #1235 from Luzifer/fix/dnslink-issues
Fix: Using the `dnslink` feature led to infinite redirects
2015-05-20 23:59:01 -04:00
Juan Batiz-Benet
d51f28e895 Merge pull request #1254 from ipfs/fix/refs-fail
fix silent refs failure
2015-05-20 23:25:02 -04:00
Juan Batiz-Benet
1c35377f9c Merge pull request #1256 from ipfs/fix/init
clean up and fix init permissions handling
2015-05-20 21:31:00 -04:00
Christian Couder
23681727e0 parse: fix parsing optional arg with stdin
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-21 00:30:08 +02:00
Jeromy
225b58e31a remove inflect package 2015-05-20 15:09:20 -07:00
Christian Couder
be3b7e13e3 parse_test: test command with optional arg
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-20 22:47:14 +02:00
Christian Couder
8d6bfec890 parse: improve stdin fix
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-20 21:28:41 +02:00
Knut Ahlers
1b3797474f Fix: Using the dnslink feature led to infinite redirects
fixes #1233
2015-05-20 19:42:28 +02:00
Jeromy
002cf5128e fix silent refs failure 2015-05-20 09:46:22 -07:00
Jeromy
8ea502f1b3 clean up and fix init permissions handling 2015-05-20 09:46:09 -07:00
Juan Batiz-Benet
01e1e71221 Merge pull request #1208 from wking/dns-resolver
Rework mutable namespace resolution to handle recursion
2015-05-20 12:42:18 -04:00
W. Trevor King
ce015d241b namesys/namesys_test: Excercise mpns.ResolveN
Shifting the generic testResolution helper from the protocol-specific
dns_test.go to the generic namesys_test.go.
2015-05-20 08:40:44 -07:00
W. Trevor King
c9fceeb19b namesys/dns_test: Add DNS resolution tests with a mock resolver 2015-05-20 08:40:44 -07:00
W. Trevor King
1e6594d087 namesys/dns: Pluggable lookupTXT field
So we can attach a mock lookup function for testing.
2015-05-20 08:40:44 -07:00
W. Trevor King
e4447b3c96 core/commands/publish: Fix published message
Previously we had a confusing situation, with:

* single-arg doc: published name <name> to <value>
* double-arg doc: published name <value> to <name>
* implementation: Published name <name> to <value>

Now we have the uniform:

  Published to <name>: <value>

With the following goals:

1. It's clear that we're writing <value> to <name>'s IPNS slot in the
   DHT.
2. We preserve the order of arguments from the command-line
   invocation:

     $ ipfs name publish <name> <value>
     Published to <name>: <value>
2015-05-20 08:40:44 -07:00
W. Trevor King
416d454b42 core/commands: Make 'ipfs name resolve' IPNS-only
And add a generic 'ipfs resolve' to handle cross-protocol name
resolution.
2015-05-20 08:40:44 -07:00
W. Trevor King
e643f72c86 core/commands/dns: Add 'ipfs dns ...' for resolving DNS references
This lets users resolve (recursively or not) DNS links without pulling
in the other protocols.  That makes an easier, more isolated target
for alternative implemenations, since they don't need to understand
IPNS, proquint, etc. to handle these resolutions.
2015-05-20 08:40:44 -07:00
W. Trevor King
c2ff02850b core/commands/resolve: Add a -r / --recursive option
For explicitly enabling recursive behaviour (it was previously always
enabled).  That allows folks who are interested in understanding
layered indirection to step through the chain one link at a time.
2015-05-20 08:40:42 -07:00
W. Trevor King
3ead2443e5 namesys: Add recursive resolution
This allows direct access to the earlier protocol-specific Resolve
implementations.  The guts of each protocol-specific resolver are in
the internal resolveOnce method, and we've added a new:

  ResolveN(ctx, name, depth)

method to the public interface.  There's also:

  Resolve(ctx, name)

which wraps ResolveN using DefaultDepthLimit.  The extra API endpoint
is intended to reduce the likelyhood of clients accidentally calling
the more dangerous ResolveN with a nonsensically high or infinite
depth.  On IRC on 2015-05-17, Juan said:

15:34 <jbenet> If 90% of uses is the reduced API with no chance to
  screw it up, that's a huge win.
15:34 <wking> Why would those 90% not just set depth=0 or depth=1,
  depending on which they need?
15:34 <jbenet> Because people will start writing `r.Resolve(ctx, name,
  d)` where d is a variable.
15:35 <wking> And then accidentally set that variable to some huge
  number?
15:35 <jbenet> Grom experience, i've seen this happen _dozens_ of
  times. people screw trivial things up.
15:35 <wking> Why won't those same people be using ResolveN?
15:36 <jbenet> Because almost every example they see will tell them to
  use Resolve(), and they will mostly stay away from ResolveN.

The per-prodocol versions also resolve recursively within their
protocol.  For example:

  DNSResolver.Resolve(ctx, "ipfs.io", 0)

will recursively resolve DNS links until the referenced value is no
longer a DNS link.

I also renamed the multi-protocol ipfs NameSystem (defined in
namesys/namesys.go) to 'mpns' (for Multi-Protocol Name System),
because I wasn't clear on whether IPNS applied to the whole system or
just to to the DHT-based system.  The new name is unambiguously
multi-protocol, which is good.  It would be nice to have a distinct
name for the DHT-based link system.

Now that resolver output is always prefixed with a namespace and
unprefixed mpns resolver input is interpreted as /ipfs/,
core/corehttp/ipns_hostname.go can dispense with it's old manual
/ipfs/ injection.

Now that the Resolver interface handles recursion, we don't need the
resolveRecurse helper in core/pathresolver.go.  The pathresolver
cleanup also called for an adjustment to FromSegments to more easily
get slash-prefixed paths.

Now that recursive resolution with the namesys/namesys.go composite
resolver always gets you to an /ipfs/... path, there's no need for the
/ipns/ special case in fuse/ipns/ipns_unix.go.

Now that DNS links can be things other than /ipfs/ or DHT-link
references (e.g. they could be /ipns/<domain-name> references) I've
also loosened the ParsePath logic to only attempt multihash validation
on IPFS paths.  It checks to ensure that other paths have a
known-protocol prefix, but otherwise leaves them alone.

I also changed some key-stringification from .Pretty() to .String()
following the potential deprecation mentioned in util/key.go.
2015-05-20 08:40:05 -07:00
W. Trevor King
04a969835e namesys/dns: Use SplitN to find dnslink references
RFC 6763 requires printable ASCII except '=' for the key [1], but
allows any character including '=' in the value [2].  This patch
adjusts our parsing to avoid splitting on '=' in the value, and then
ignoring anything after that split.

[1]: https://tools.ietf.org/html/rfc6763#section-6.4
[2]: https://tools.ietf.org/html/rfc6763#section-6.5
2015-05-19 19:54:13 -07:00
W. Trevor King
03260a9281 namesys/interface: Expand package docs to discuss mutable names
What they are, why you'd use them, and which command-line tools you
can use to access this functionality.
2015-05-19 19:54:12 -07:00
W. Trevor King
02cb5f3b32 namesys/publisher: Drop the 'namesys: ' prefix for the Publish log
This is already handled by setup in namesys/routing.go:

  var log = u.Logger("namesys")
2015-05-19 19:54:12 -07:00
Lars Gierth
2eea1b05b7 parse: fix handling of unwanted stdin
There can be non-terminal (i.e. non-interactive) sessions
that are *not* a pipe, for example:

	ssh user@host ipfs version

In this case, it looks like we should read from stdin.
Parsing stdin is accomplished by deliberately triggering
the parsing loop once.

We didn't previously check whether there is an ArgDef to support
that loop iteration.
2015-05-20 04:25:56 +02:00
Lars Gierth
4e0ca860e9 parse_test: test unwanted stdin 2015-05-20 04:23:43 +02:00
Juan Batiz-Benet
7157574619 Merge pull request #1250 from ipfs/test-cat-with-stdin
t0040: add tests for ipfs cat with stdin
2015-05-19 20:08:45 -04:00
Juan Batiz-Benet
dcd34c6bb1 Merge pull request #1251 from ipfs/travis-split-go-sharness
.travis: split go and sharness tests
2015-05-19 20:06:38 -04:00
Christian Couder
7bf18cafe0 .travis: split go and sharness tests
Following: https://github.com/ipfs/infrastructure/issues/20#issuecomment-102665147

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-19 19:33:04 -04:00
Juan Batiz-Benet
c153554866 Merge pull request #1252 from ipfs/fix-bitswap-ci
bitswap/test: fix timeout on travis
2015-05-19 19:32:36 -04:00
Juan Batiz-Benet
d7794c7d75 travis: disable kvm setup
Seems to be too unstable?
2015-05-19 19:08:04 -04:00
Juan Batiz-Benet
bc6911ef37 bitswap/test: fix timeout on travis 2015-05-19 16:53:13 -04:00
Christian Couder
863f386251 t0040: add tests for ipfs cat with stdin
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-19 21:28:17 +02:00