1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-28 01:16:10 +03:00

Merge pull request #724 from schollz:schollz/issue723

fix: receiver needs to exit without initializing files if no files being transfered
This commit is contained in:
Zack 2024-05-31 11:45:51 -07:00 committed by GitHub
commit 23dce2aa3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1064,7 +1064,7 @@ func (c *Client) Receive() (err error) {
err = c.transfer()
if err == nil {
if c.numberOfTransferredFiles+len(c.EmptyFoldersToTransfer) == 0 {
fmt.Fprintf(os.Stderr, "\rNo files transferred.")
fmt.Fprintf(os.Stderr, "\rNo files transferred.\n")
}
}
return
@ -1638,6 +1638,7 @@ func (c *Client) recipientGetFileReady(finished bool) (err error) {
}
c.SuccessfulTransfer = true
c.FilesHasFinished[c.FilesToTransferCurrentNum] = struct{}{}
return
}
err = c.recipientInitializeFile()