1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-19 09:52:03 +08:00

make disconnects and reconnects work a little better

This commit is contained in:
Jeromy
2014-09-11 02:20:04 +00:00
committed by Juan Batiz-Benet
parent da1890e5ef
commit c41a9717fe
4 changed files with 7 additions and 1 deletions

View File

@ -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"

View File

@ -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
}

View File

@ -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)

View File

@ -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
}