0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

Fix debug progressbar bug and make sure to clean enc.0

This commit is contained in:
Zack Scholl 2018-04-13 15:21:15 -07:00
parent 78df00f7ab
commit 39e2a20a6f

View file

@ -124,8 +124,11 @@ func NewConnection(config *AppConfig) (*Connection, error) {
func (c *Connection) cleanup() { func (c *Connection) cleanup() {
log.Debug("cleaning") log.Debug("cleaning")
for id := 1; id <= 8; id++ { for id := 0; id <= 8; id++ {
os.Remove(path.Join(c.Path, c.File.Name+".enc."+strconv.Itoa(id))) err := os.Remove(path.Join(c.Path, c.File.Name+".enc."+strconv.Itoa(id)))
if err == nil {
log.Debugf("removed %s", path.Join(c.Path, c.File.Name+".enc."+strconv.Itoa(id)))
}
} }
os.Remove(path.Join(c.Path, c.File.Name+".enc")) os.Remove(path.Join(c.Path, c.File.Name+".enc"))
} }
@ -340,7 +343,10 @@ func (c *Connection) runClient() error {
responses.Lock() responses.Lock()
responses.startTime = time.Now() responses.startTime = time.Now()
responses.Unlock() responses.Unlock()
c.bar.Reset() if !c.Debug {
c.bar.Reset()
}
if err := c.sendFile(id, connection); err != nil { if err := c.sendFile(id, connection); err != nil {
log.Error(err) log.Error(err)
} }