mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
reduce complexity
This commit is contained in:
parent
8be63bed43
commit
4e94a22300
1 changed files with 9 additions and 10 deletions
|
@ -799,7 +799,6 @@ func (c *Client) recipientGetFileReady(finished bool) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) updateIfRecipientHasFileInfo() (err error) {
|
func (c *Client) updateIfRecipientHasFileInfo() (err error) {
|
||||||
|
|
||||||
if !(!c.Options.IsSender && c.Step2FileInfoTransfered && !c.Step3RecipientRequestFile) {
|
if !(!c.Options.IsSender && c.Step2FileInfoTransfered && !c.Step3RecipientRequestFile) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -851,16 +850,16 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
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) {
|
||||||
|
log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash)
|
||||||
|
} else {
|
||||||
|
log.Debugf("hashes are equal %x == %x", fileHash, fileInfo.Hash)
|
||||||
|
}
|
||||||
|
if errHash != nil {
|
||||||
|
// probably can't find, its okay
|
||||||
|
log.Debug(errHash)
|
||||||
|
}
|
||||||
if errHash != nil || !bytes.Equal(fileHash, fileInfo.Hash) {
|
if errHash != nil || !bytes.Equal(fileHash, fileInfo.Hash) {
|
||||||
if errHash != nil {
|
|
||||||
// probably can't find, its okay
|
|
||||||
log.Debug(errHash)
|
|
||||||
}
|
|
||||||
if !bytes.Equal(fileHash, fileInfo.Hash) {
|
|
||||||
log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash)
|
|
||||||
} else {
|
|
||||||
log.Debugf("hashes are equal %x == %x", fileHash, fileInfo.Hash)
|
|
||||||
}
|
|
||||||
finished = false
|
finished = false
|
||||||
c.FilesToTransferCurrentNum = i
|
c.FilesToTransferCurrentNum = i
|
||||||
break
|
break
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue