diff --git a/main.go b/main.go index 8561c259..46ecd7f3 100644 --- a/main.go +++ b/main.go @@ -35,7 +35,7 @@ func main() { // PathToFile: "../wskeystore/README.md", // PathToFile: "./src/croc/croc.go", // PathToFiles: []string{"C:\\Users\\zacks\\go\\src\\github.com\\schollz\\croc\\src\\croc\\croc.go", "croc.exe"}, - PathToFiles: []string{"croc2.exe"}, //,"croc2.exe", "croc3.exe"}, + PathToFiles: []string{"croc2.exe", "croc3.exe"}, //,"croc2.exe", "croc3.exe"}, //PathToFiles: []string{"README.md"}, //,"croc2.exe", "croc3.exe"}, KeepPathInRemote: false, }) diff --git a/src/croc/croc.go b/src/croc/croc.go index 570ac63a..640413a0 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -36,7 +36,7 @@ var log = logrus.New() func init() { log.SetFormatter(&logrus.TextFormatter{ForceColors: true}) log.SetOutput(colorable.NewColorableStdout()) - log.SetLevel(logrus.DebugLevel) + Debug(false) } func Debug(debug bool) { @@ -268,7 +268,7 @@ func (c *Client) transfer(options TransferOptions) (err error) { if len(machID) > 6 { machID = machID[:6] } - fmt.Fprintf(os.Stderr, "Sending %s (%s) as '%s'\n", fname, utils.ByteCountDecimal(totalFilesSize), machID) + fmt.Fprintf(os.Stderr, "Sending %s (%s) from your machine, '%s'\n", fname, utils.ByteCountDecimal(totalFilesSize), machID) } // create channel for quitting // quit with c.quit <- true diff --git a/src/webrtc/pkg/session/sender/sender.go b/src/webrtc/pkg/session/sender/sender.go index 96f66f2c..3f1c6c07 100644 --- a/src/webrtc/pkg/session/sender/sender.go +++ b/src/webrtc/pkg/session/sender/sender.go @@ -65,6 +65,7 @@ type Session struct { readingStats *stats.Stats bar *progressbar.ProgressBar fileSize int64 + fname string firstByte bool } @@ -184,6 +185,7 @@ func (s *Session) readFile(pathToFile string) error { } stat, _ := f.Stat() s.fileSize = stat.Size() + s.fname = stat.Name() s.firstByte = true log.Debugf("Starting to read data from '%s'", pathToFile) s.readingStats.Start() @@ -253,10 +255,11 @@ func (s *Session) onBufferedAmountLow() func() { s.firstByte = false s.bar = progressbar.NewOptions64( s.fileSize, + progressbar.OptionSetDescription(s.fname), progressbar.OptionSetRenderBlankState(true), progressbar.OptionSetBytes64(s.fileSize), progressbar.OptionSetWriter(os.Stderr), - progressbar.OptionThrottle(1/60*time.Second), + progressbar.OptionThrottle(100*time.Millisecond), ) } s.bar.Add(cur.n)