mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
fix bar
This commit is contained in:
parent
c8c532c5dd
commit
7f0b919b0b
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue