diff --git a/go.mod b/go.mod index 8143b7f..b20ac34 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/schollz/mnemonicode v1.0.1 github.com/schollz/pake/v2 v2.0.2 github.com/schollz/peerdiscovery v1.5.0 - github.com/schollz/progressbar/v2 v2.15.0 + github.com/schollz/progressbar/v3 v3.0.0 github.com/schollz/spinner v0.0.0-20180925172146-6bbc5f7804f9 github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum index 83a4bd7..1ffa123 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,8 @@ github.com/schollz/peerdiscovery v1.5.0 h1:olfRgADOF4iVHfA6QSf5fNTCXWf9bQ0CcAHu+ github.com/schollz/peerdiscovery v1.5.0/go.mod h1:rtU51ZXRfyF8ugujcsOTxM8Jerx19+62Wq2zx2QGYsg= github.com/schollz/progressbar/v2 v2.15.0 h1:dVzHQ8fHRmtPjD3K10jT3Qgn/+H+92jhPrhmxIJfDz8= github.com/schollz/progressbar/v2 v2.15.0/go.mod h1:UdPq3prGkfQ7MOzZKlDRpYKcFqEMczbD7YmbPgpzKMI= +github.com/schollz/progressbar/v3 v3.0.0 h1:N4MqUpgTO75vC0VmVtDNcnBNQinQjbPpKah6F+d34QY= +github.com/schollz/progressbar/v3 v3.0.0/go.mod h1:d+PD64vPuv+GL2EhUpvV579FR91WWhRHEnImqGsIBU4= github.com/schollz/spinner v0.0.0-20180925172146-6bbc5f7804f9 h1:y08o5oQ/slxXE/F0uh5dd8mdVvb+w4NLcNSDSq4c2F0= github.com/schollz/spinner v0.0.0-20180925172146-6bbc5f7804f9/go.mod h1:kCMoQsqzx4MzGJWaALr6tKyCnlrY0kILGLkA1FOiLF4= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= diff --git a/src/croc/croc.go b/src/croc/croc.go index 0c55392..fac97cb 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -29,7 +29,7 @@ import ( log "github.com/schollz/logger" "github.com/schollz/pake/v2" "github.com/schollz/peerdiscovery" - "github.com/schollz/progressbar/v2" + "github.com/schollz/progressbar/v3" "github.com/schollz/spinner" "github.com/tscholl2/siec" ) @@ -707,15 +707,16 @@ func (c *Client) processMessageSalt(m message.Message) (done bool, err error) { if c.Options.IsSender { log.Debug("sending external IP") err = message.Send(c.conn[0], c.Key, message.Message{ - Type: "externalip", - Bytes: m.Bytes, + Type: "externalip", + Message: c.ExternalIP, + Bytes: m.Bytes, }) } return } func (c *Client) processExternalIP(m message.Message) (done bool, err error) { - log.Debug("received external IP") + log.Debug("received external IP: %+v", m) if !c.Options.IsSender { err = message.Send(c.conn[0], c.Key, message.Message{ Type: "externalip", @@ -970,7 +971,7 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error) progressbar.OptionSetWidth(20), progressbar.OptionSetDescription(description), progressbar.OptionSetRenderBlankState(true), - progressbar.OptionSetBytes64(1), + progressbar.OptionShowBytes(true), progressbar.OptionSetWriter(os.Stderr), ) c.bar.Finish() @@ -1054,7 +1055,7 @@ func (c *Client) updateState() (err error) { progressbar.OptionSetWidth(20), progressbar.OptionSetDescription(description), progressbar.OptionSetRenderBlankState(true), - progressbar.OptionSetBytes64(1), + progressbar.OptionShowBytes(true), progressbar.OptionSetWriter(os.Stderr), ) c.bar.Finish() @@ -1097,7 +1098,7 @@ func (c *Client) setBar() { progressbar.OptionSetWidth(20), progressbar.OptionSetDescription(description), progressbar.OptionSetRenderBlankState(true), - progressbar.OptionSetBytes64(c.FilesToTransfer[c.FilesToTransferCurrentNum].Size), + progressbar.OptionShowBytes(true), progressbar.OptionSetWriter(os.Stderr), progressbar.OptionThrottle(100*time.Millisecond), )