0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00
This commit is contained in:
Zack Scholl 2018-09-25 18:25:12 -07:00
parent c8c532c5dd
commit 7f0b919b0b

View file

@ -9,6 +9,7 @@ import (
"os"
"path/filepath"
"strings"
"sync"
"time"
log "github.com/cihub/seelog"
@ -345,8 +346,11 @@ func send(forceSend int, serverAddress string, tcpPorts []string, isLocal bool,
}
}
} else {
var wg sync.WaitGroup
wg.Add(len(tcpConnections))
for i := range tcpConnections {
go func(dataChan <-chan DataChan, tcpConnection comm.Comm) {
defer wg.Done()
for data := range dataChan {
if data.err != nil {
log.Error(data.err)
@ -367,7 +371,7 @@ func send(forceSend int, serverAddress string, tcpPorts []string, isLocal bool,
}
}(dataChan, tcpConnections[i])
}
wg.Wait()
}
bar.Finish()