From e384aec2a973e628e16fa1705dcc36aa533f602c Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Tue, 3 Feb 2015 12:17:59 -0800 Subject: [PATCH 1/2] cmds/root: ipfs root text arrangement --- core/commands/root.go | 51 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/core/commands/root.go b/core/commands/root.go index e0cd8481d..0ab07fecb 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -22,7 +22,7 @@ var Root = &cmds.Command{ ipfs [] [] ... `, ShortDescription: ` -Basic commands: +BASIC COMMANDS init Initialize ipfs local configuration add Add an object to ipfs @@ -31,34 +31,35 @@ Basic commands: ls List links from an object refs List hashes of links from an object -Tool commands: - - config Manage configuration - update Download and apply go-ipfs updates - version Show ipfs version information - commands List all available commands - id Show info about ipfs peers - pin Pin objects to local storage - name Publish or resolve IPNS names - log Change the logging level - -Advanced Commands: - - daemon Start a long-running daemon process - mount Mount an ipfs read-only mountpoint - diag Print diagnostics - -Network commands: - - swarm Manage connections to the p2p network - bootstrap Add or remove bootstrap peers - ping Measure the latency of a connection - -Plumbing commands: +DATA STRUCTURE COMMANDS block Interact with raw blocks in the datastore object Interact with raw dag nodes +ADVANCED COMMANDS + + daemon Start a long-running daemon process + mount Mount an ipfs read-only mountpoint + name Publish or resolve IPNS names + pin Pin objects to local storage + gc Garbage collect unpinned objects + +NETWORK COMMANDS + + id Show info about ipfs peers + bootstrap Add or remove bootstrap peers + swarm Manage connections to the p2p network + dht Query the dht for values or peers + ping Measure the latency of a connection + diag Print diagnostics + +TOOL COMMANDS + + config Manage configuration + version Show ipfs version information + update Download and apply go-ipfs updates + commands List all available commands + Use 'ipfs --help' to learn more about each command. `, }, From d8a5bd054948c11c9b1a4da4fd0f5e25bb76271a Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Tue, 3 Feb 2015 12:18:30 -0800 Subject: [PATCH 2/2] dht/query: make sure to cancel all contexts. We are leaking peer queues: http://gateway.ipfs.io/ipfs/QmQxVA48CzVwwNYExUiFe56VrUBn8u368ZfchnCLoc7fSC/moriarty --- routing/dht/query.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routing/dht/query.go b/routing/dht/query.go index 293c0ddd9..7a32b45bb 100644 --- a/routing/dht/query.go +++ b/routing/dht/query.go @@ -52,6 +52,9 @@ type queryFunc func(context.Context, peer.ID) (*dhtQueryResult, error) // Run runs the query at hand. pass in a list of peers to use first. func (q *dhtQuery) Run(ctx context.Context, peers []peer.ID) (*dhtQueryResult, error) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + runner := newQueryRunner(ctx, q) return runner.Run(peers) }