Commit Graph

765 Commits

Author SHA1 Message Date
Tor Arne Vestbø
6fe85496f5 corehttp: disable HTTP keep-alive when shutting down server
Once the server is asked to shut down, we stop accepting new
connections, but the 'manners' graceful shutdown will wait for
all existing connections closed to close before finishing.

For keep-alive connections this will never happen unless the
client detects that the server is shutting down through the
ipfs API itself, and closes the connection in response.

This is a problem e.g. with the webui's connections visualization,
which polls the swarm/peers endpoint once a second, and never
detects that the API server was shut down.

We can mitigate this by telling the server to disable keep-alive,
which will add a 'Connection: close' header to the next HTTP
response on the connection. A well behaving client should then
treat that correspondingly by closing the connection.

Unfortunately this doesn't happen immediately in all cases,
presumably depending on the keep-alive timeout of the browser
that set up the connection, but it's at least a step in the
right direction.
2015-04-20 14:55:42 +02:00
Tor Arne Vestbø
c9d3084910 corehttp: ensure node closing/teardown waits for server termination
When closing a node, the node itself only takes care of tearing down
its own children. As corehttp sets up a server based on a node, it
needs to also ensure that the server is accounted for when determining
if the node has been fully closed.
2015-04-20 14:55:42 +02:00
Tor Arne Vestbø
cc830ff2ee corehttp: log when server takes a long time to shut down
The server may stay alive for quite a while due to waiting on
open connections to close before shutting down. We should
find ways to terminate these connections in a more controlled
manner, but in the meantime it's helpful to be able to see
why a shutdown of the ipfs daemon is taking so long.
2015-04-20 14:55:42 +02:00
Christian Couder
96a22c5bb1 config: change default config dir name to .ipfs
This changes .go-ipfs to .ipfs everywhere.
And by the way this defines a DefaultPathName const
for this name.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-04-20 02:25:41 -07:00
Juan Batiz-Benet
c79dddd3d3 core: resolve error + bounds check
- handle error on "/ipns/"
- bounds-check, otherwise might cause a panic
2015-04-20 01:49:22 -07:00
Juan Batiz-Benet
928581c9e7 Merge pull request #1071 from ipfs/add-err-fix
cmds/add: silent error fix
2015-04-20 01:48:54 -07:00
Juan Batiz-Benet
218aeeb77e cmds/add: silent error fix 2015-04-20 01:18:42 -07:00
gatesvp
31ff954539 Move IPNS resolutions into the core library
Move IPNS resolutions into the core library via the pathresolver.go
file. Fix the CLI commands to leverage this core component.
2015-04-20 01:04:30 -07:00
Juan Batiz-Benet
140cd1fd1b remove debugerrors
We now consider debugerrors harmful: we've run into cases where
debugerror.Wrap() hid valuable error information (err == io.EOF?).
I've removed them from the main code, but left them in some tests.
Go errors are lacking, but unfortunately, this isn't the solution.

It is possible that debugerros.New or debugerrors.Errorf should
remain still (i.e. only remove debugerrors.Wrap) but we don't use
these errors often enough to keep.
2015-04-20 00:35:35 -07:00
Jeromy
0a6b880bee fix for #1008 and other pinning fixes
This commit adds a new set of sharness tests for pinning, and addresses
bugs that were pointed out by said tests.

test/sharness: added more pinning tests

Pinning is currently broken. See issue #1051. This commit introduces
a few more pinning tests. These are by no means exhaustive, but
definitely surface the present problems going on. I believe these
tests are correct, but not sure. Pushing them as failing so that
pinning is fixed in this PR.

make pinning and merkledag.Get take contexts

improve 'add' commands usage of pinning

FIXUP: fix 'pin lists look good'

ipfs-pin-stat simple script to help check pinning

This is a simple shell script to help check pinning.

We ought to strive towards making adding commands this easy.
The http api is great and powerful, but our setup right now
gets in the way. Perhaps we can clean up that area.

updated t0081-repo-pinning

- fixed a couple bugs with the tests
- made it a bit clearer (still a lot going on)
- the remaining tests are correct and highlight a problem with
  pinning. Namely, that recursive pinning is buggy. At least:
  towards the end of the test, $HASH_DIR4 and $HASH_FILE4 should
  be pinned indirectly, but they're not. And thus get gc-ed out.
  There may be other problems too.

cc @whyrusleeping

fix grep params for context deadline check

fix bugs in pin and pin tests

check for block local before checking recursive pin
2015-04-19 23:40:25 -07:00
Etienne Laurin
233c39ff62 publish by path 2015-04-12 21:51:58 +00:00
Juan Batiz-Benet
69db1b4ec5 bugfix: add was not setting error 2015-04-12 07:53:04 -07:00
Juan Batiz-Benet
3c1d78c672 corehttp: added support for HEAD requests
This commit adds HEAD support to the IPFS Gateway.
Related: #840
2015-04-12 02:35:16 -07:00
Jeromy
f10c8282c7 handle error from GetClosestPeers 2015-04-06 00:08:28 -07:00
Jeromy
2c8cb9fc75 bandwidth metering on streams
humanize bandwidth output

instrument conn.Conn for bandwidth metrics

add poll command for continuous bandwidth reporting

move bandwidth tracking onto multiaddr net connections

another mild refactor of recording locations

address concerns from PR

lower mock nodes in race test due to increased goroutines per connection
2015-03-31 19:58:08 -07:00
Ho-Sheng Hsiao
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Jeromy
13c489eca1 fix context respect through fuse reading 2015-03-24 12:23:01 -07:00
Henry
07008042f1 ipfs ls: added --headers option
- added tests for 'ipfs ls --headers'
- comments from CR (opts)
- sharness: fix ls test whitespace
2015-03-20 15:34:56 -07:00
Juan Batiz-Benet
8a3db7cbc4 testing: nofuse testing (for osx travis) 2015-03-18 01:44:36 -07:00
Jeromy
7ad8dd8523 ignore bootstrap failures in namesys initialization 2015-03-17 21:57:57 -07:00
Jeromy
f679127d83 comments! and cleanup 2015-03-17 20:57:21 -07:00
Jeromy
eb228eb615 remove addCloser 2015-03-17 20:57:21 -07:00
Jeromy
9ab59e44ad implement in memory model for ipns filesystem, to be used as backing for ipns fuse interface 2015-03-17 20:57:20 -07:00
Andy Leap
512171aa98 Fixing test failure(issue with looking for exact text) 2015-03-16 16:27:34 -04:00
Andy Leap
89ca37d1d1 Fixes issue #924 2015-03-16 16:08:45 -04:00
Tommi Virtanen
fdd1cd8dc0 Remove fsrepo.At, make Open a constructor function
Nobody calls At without immediately calling Open.

First step, a mechanical transformation. Cleanups will follow.
2015-03-13 20:19:03 -07:00
Henry
b688e72de0 ipfs object put: return error if object is empty (fixes #883) 2015-03-10 22:58:50 +01:00
Henry
759437e054 ls: introduce specific output types (removes IsDir from object plumbing commands) 2015-03-10 13:56:57 +01:00
Henry
d88ba19357 disabled 'ipfs update' command for now 2015-03-09 10:22:11 +01:00
Henry
e8403b1f11 removed dead code
- old http server (superseeded by core/corehttp)
- unused makeDatastore() helpers
2015-03-09 10:21:35 +01:00
anarcat
451222cf1d gc is actually repo gc, reflect in docs
not exactly elegant, but fixes #871 in the short term. in the mid term, unless more `repo` commands show up, i suggest just replacing `repo gc` simply by `gc`.
2015-03-08 18:05:42 -04:00
Juan Batiz-Benet
bff7f73068 Merge pull request #878 from jbenet/dontIgnoreCancelFuncs
context: Always call returned cancel funcs
2015-03-07 09:49:19 -08:00
Juan Batiz-Benet
1d5b903611 added cancel func calls previously ignored 2015-03-07 09:31:46 -08:00
Juan Batiz-Benet
dfe2b16763 cmds/id: use req context -- dont timeout unnecessarily
commands should last as long as the user keeps the cmd going
2015-03-07 09:24:15 -08:00
Henry
bc84ffafe3 enable stdin input for ipfs object put 2015-03-07 16:50:00 +01:00
anarcat
6a3578be84 explain what direct/indirect/recursive means
i couldn't understand what those meant. it was explain (at least partly) in #590 so let's share the goods!
2015-03-07 08:32:48 -05:00
Tonis Tiigi
0f69823077 Add nofuse build tag to darwin mounter 2015-03-05 18:00:45 +02:00
Tonis Tiigi
91ab1401ab Fix nofuse build tags syntax 2015-03-05 18:00:36 +02:00
Henry
e55aaf3f83 nofuse: better help description for 'ipfs mount' 2015-03-05 01:24:17 +01:00
Henry
66f1035d93 simple nofuse build tag to allow freebsd compilation and maybe pave the way towards windows as well 2015-03-05 01:24:17 +01:00
Juan Batiz-Benet
51a8bcbf64 Merge pull request #847 from jbenet/publish-webui
published new webui
2015-03-02 23:38:30 -08:00
Juan Batiz-Benet
7bc1de4ec5 published new webui
/ipfs/QmXX7YRpU7nNBKfw75VG7Y1c3GwpSAGHRev67XVPgZFv9R

ee74f75d0b
2015-03-02 23:33:10 -08:00
Juan Batiz-Benet
9f27556090 Merge pull request #823 from BrendanBenshoof/master
fixing bug 812
2015-03-02 17:02:24 -08:00
bbenshoof
ac5cfc5664 fixing bug 812 2015-03-02 17:07:21 -05:00
Henry
607468a96d beautify 'ipfs ls' and 'ipfs object links' (updates #799) 2015-03-01 14:03:51 +01:00
Jeromy
3c8a391fe4 dont put wantlist getter in exchange interface 2015-02-27 00:12:21 -08:00
Jeromy
98a183d53e fix output formatting on stat 2015-02-27 00:12:21 -08:00
Jeromy
b514478f32 rename wantlist to bitswap, add stat command 2015-02-27 00:12:21 -08:00
Jeromy
559a241566 implement a simple wantlist command to allow the user to view their wantlist 2015-02-27 00:12:21 -08:00
Jeromy
7fb63d7e43 move signing options into a validation checker struct 2015-02-26 22:05:03 -08:00