send and receive text

This commit is contained in:
Zack Scholl 2020-09-02 17:33:53 -07:00
parent 48d63e4854
commit 8fbb7e5019
3 changed files with 6 additions and 3 deletions

2
go.mod
View File

@ -15,7 +15,7 @@ require (
github.com/schollz/mnemonicode v1.0.1
github.com/schollz/pake/v2 v2.0.4
github.com/schollz/peerdiscovery v1.5.2
github.com/schollz/progressbar/v3 v3.4.0
github.com/schollz/progressbar/v3 v3.5.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

4
go.sum
View File

@ -47,8 +47,8 @@ github.com/schollz/peerdiscovery v1.5.2 h1:gc1iXQ0A9xj58nm7QHs5a1tCoYv7QDIrZbQfZ
github.com/schollz/peerdiscovery v1.5.2/go.mod h1:hSU7N/NkfNH6AZwU/WBcDZtMABVbTfAWk/XD3XKxN+s=
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.4.0 h1:jHd2FiF+zpPc7di1m9cHRgt8AaUvId3L5p4bF9Nux9g=
github.com/schollz/progressbar/v3 v3.4.0/go.mod h1:Rp5lZwpgtYmlvmGo1FyDwXMqagyRBQYSDwzlP9QDu84=
github.com/schollz/progressbar/v3 v3.5.0 h1:rVya3NTks1kFmuFKaLYWt/3TYDiE+Cxb1iXuxeEjf5c=
github.com/schollz/progressbar/v3 v3.5.0/go.mod h1:Rp5lZwpgtYmlvmGo1FyDwXMqagyRBQYSDwzlP9QDu84=
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=

View File

@ -1097,6 +1097,7 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error)
progressbar.OptionShowBytes(true),
progressbar.OptionShowCount(),
progressbar.OptionSetWriter(os.Stderr),
progressbar.OptionSetVisibility(!c.Options.SendingText),
)
c.bar.Finish()
return
@ -1182,6 +1183,7 @@ func (c *Client) updateState() (err error) {
progressbar.OptionShowBytes(true),
progressbar.OptionShowCount(),
progressbar.OptionSetWriter(os.Stderr),
progressbar.OptionSetVisibility(!c.Options.SendingText),
)
c.bar.Finish()
}
@ -1227,6 +1229,7 @@ func (c *Client) setBar() {
progressbar.OptionShowCount(),
progressbar.OptionSetWriter(os.Stderr),
progressbar.OptionThrottle(100*time.Millisecond),
progressbar.OptionSetVisibility(!c.Options.SendingText),
)
byteToDo := int64(len(c.CurrentFileChunks) * models.TCP_BUFFER_SIZE / 2)
if byteToDo > 0 {