mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-20 02:21:48 +08:00
make disconnects and reconnects work a little better
This commit is contained in:
@ -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"
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user