From c41a9717fe56a3f8e92c9694a594271818cc430d Mon Sep 17 00:00:00 2001 From: Jeromy Date: Thu, 11 Sep 2014 02:20:04 +0000 Subject: [PATCH] make disconnects and reconnects work a little better --- cmd/ipfs/ipfs.go | 2 +- crypto/spipe/handshake.go | 4 ++++ fuse/readonly/readonly_unix.go | 1 + path/path.go | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go index d6fbac0bf..1627131d0 100644 --- a/cmd/ipfs/ipfs.go +++ b/cmd/ipfs/ipfs.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" "os" - "runtime/pprof" + "runtime" "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag" "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander" diff --git a/crypto/spipe/handshake.go b/crypto/spipe/handshake.go index f617c75b3..67af992fd 100644 --- a/crypto/spipe/handshake.go +++ b/crypto/spipe/handshake.go @@ -229,6 +229,8 @@ func (s *SecurePipe) handleSecureIn(hashType string, tIV, tCKey, tMKey []byte) { for { data, ok := <-s.insecure.In if !ok { + u.DOut("Closing incoming proxy.\n") + close(secureIn) return } @@ -265,6 +267,8 @@ func (s *SecurePipe) handleSecureOut(hashType string, mIV, mCKey, mMKey []byte) for { data, ok := <-s.Out if !ok { + u.DOut("Closing outgoing proxy.\n") + close(secureOut) return } diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index aa62429a4..0ce5fab4c 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -168,6 +168,7 @@ func Mount(ipfs *core.IpfsNode, fpath string) error { } time.Sleep(time.Millisecond * 10) } + ipfs.Swarm.Close() }() c, err := fuse.Mount(fpath) diff --git a/path/path.go b/path/path.go index a06fb98cb..eb5ce6660 100644 --- a/path/path.go +++ b/path/path.go @@ -38,6 +38,7 @@ func (s *Resolver) ResolvePath(fpath string) (*merkledag.Node, error) { // first element in the path is a b58 hash (for now) h, err := mh.FromB58String(parts[0]) if err != nil { + u.DOut("given path element is not a base58 string.\n") return nil, err }