From 71fee31da0dc4e7804aaa387a0371867e876dc7c Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Tue, 25 Sep 2018 17:18:43 -0700 Subject: [PATCH] TCP ports use lots --- src/recipient/recipient.go | 4 +--- src/sender/sender.go | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/recipient/recipient.go b/src/recipient/recipient.go index fc8f368..b6db4c9 100644 --- a/src/recipient/recipient.go +++ b/src/recipient/recipient.go @@ -292,7 +292,6 @@ func receive(forceSend int, serverAddress string, tcpPorts []string, isLocal boo dataChan <- message } } - _ = <-finished } else { log.Debugf("starting listening with tcp with %d connections", len(tcpConnections)) // using TCP @@ -324,8 +323,7 @@ func receive(forceSend int, serverAddress string, tcpPorts []string, isLocal boo } _ = <-finished - log.Debug("finished") - + log.Debug("telling sender i'm done") c.WriteMessage(websocket.BinaryMessage, []byte("done")) // we are finished transferTime = time.Since(startTime) diff --git a/src/sender/sender.go b/src/sender/sender.go index 049c3ca..9c3c832 100644 --- a/src/sender/sender.go +++ b/src/sender/sender.go @@ -342,10 +342,9 @@ func send(forceSend int, serverAddress string, tcpPorts []string, isLocal bool, return err } if bytes.Equal(data.b, []byte("magic")) { - return + break } } - } else { for i := range tcpConnections { go func(tcpConnection comm.Comm) { @@ -355,7 +354,6 @@ func send(forceSend int, serverAddress string, tcpPorts []string, isLocal bool, log.Error(data.err) return } - bar.Add(data.bytesRead) // write data to tcp connection _, err = tcpConnection.Write(data.b) @@ -383,6 +381,7 @@ func send(forceSend int, serverAddress string, tcpPorts []string, isLocal bool, case 5: transferTime := time.Since(startTransfer) if !bytes.HasPrefix(message, []byte("hash:")) { + log.Debugf("%s", message) continue } c.WriteMessage(websocket.BinaryMessage, fileHash)