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:
parent
78df00f7ab
commit
39e2a20a6f
1 changed files with 9 additions and 3 deletions
12
connect.go
12
connect.go
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue