提交 38182447 作者: Juan Batiz-Benet

Bugfix: daemon wg sync

上级 ee1ba164
......@@ -2,9 +2,9 @@ package main
import (
"encoding/base64"
"path/filepath"
"errors"
"os"
"path/filepath"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
......
......@@ -94,7 +94,10 @@ func (dl *DaemonListener) Listen() {
panic("attempting to listen on a closed daemon Listener")
}
// add ourselves to workgroup. and remove ourselves when done.
dl.wg.Add(1)
defer dl.wg.Done()
log.Info("daemon listening")
for {
conn, err := dl.list.Accept()
......@@ -102,7 +105,6 @@ func (dl *DaemonListener) Listen() {
if !dl.closed {
log.Warning("DaemonListener Accept: %v", err)
}
dl.lk.Close()
return
}
go dl.handleConnection(conn)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论