Commit 38182447 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Bugfix: daemon wg sync

parent ee1ba164
...@@ -2,9 +2,9 @@ package main ...@@ -2,9 +2,9 @@ package main
import ( import (
"encoding/base64" "encoding/base64"
"path/filepath"
"errors" "errors"
"os" "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/gonuts/flag"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander" "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
......
...@@ -94,7 +94,10 @@ func (dl *DaemonListener) Listen() { ...@@ -94,7 +94,10 @@ func (dl *DaemonListener) Listen() {
panic("attempting to listen on a closed daemon Listener") panic("attempting to listen on a closed daemon Listener")
} }
// add ourselves to workgroup. and remove ourselves when done.
dl.wg.Add(1) dl.wg.Add(1)
defer dl.wg.Done()
log.Info("daemon listening") log.Info("daemon listening")
for { for {
conn, err := dl.list.Accept() conn, err := dl.list.Accept()
...@@ -102,7 +105,6 @@ func (dl *DaemonListener) Listen() { ...@@ -102,7 +105,6 @@ func (dl *DaemonListener) Listen() {
if !dl.closed { if !dl.closed {
log.Warning("DaemonListener Accept: %v", err) log.Warning("DaemonListener Accept: %v", err)
} }
dl.lk.Close()
return return
} }
go dl.handleConnection(conn) go dl.handleConnection(conn)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment