1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 05:11:06 +02:00
This commit is contained in:
Zack Scholl 2021-04-20 15:44:28 -07:00
parent 7ac7be37af
commit 85e7576311

View file

@ -225,6 +225,7 @@ func (c *Client) sendCollectFiles(options TransferOptions) (err error) {
log.Debugf("%+v", c.FilesToTransfer[i]) log.Debugf("%+v", c.FilesToTransfer[i])
} }
c.FilesToTransfer[i].Hash, err = utils.HashFile(fullPath, c.Options.HashAlgorithm) c.FilesToTransfer[i].Hash, err = utils.HashFile(fullPath, c.Options.HashAlgorithm)
log.Debugf("hashed %s to %x using %s", fullPath, c.FilesToTransfer[i].Hash, c.Options.HashAlgorithm)
totalFilesSize += fstats.Size() totalFilesSize += fstats.Size()
if err != nil { if err != nil {
return return
@ -1261,6 +1262,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) {
} }
log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash) log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash)
if !bytes.Equal(fileHash, fileInfo.Hash) { if !bytes.Equal(fileHash, fileInfo.Hash) {
log.Debugf("hashed %s to %x using %s", fileInfo.Name, fileHash, c.Options.HashAlgorithm)
log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash) log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash)
if errHash == nil && !c.Options.Overwrite && errRecipientFile == nil { if errHash == nil && !c.Options.Overwrite && errRecipientFile == nil {
log.Debug("asking to overwrite") log.Debug("asking to overwrite")