Debug output on request errors

This commit is contained in:
Jakob Borg 2015-07-10 16:01:10 +10:00
parent cb1a7a7bdc
commit b78c515724

View File

@ -1185,6 +1185,9 @@ func (p *rwFolder) pullerRoutine(in <-chan pullBlockState, out chan<- *sharedPul
buf, lastError := p.model.requestGlobal(selected, p.folder, state.file.Name, state.block.Offset, int(state.block.Size), state.block.Hash, 0, nil) buf, lastError := p.model.requestGlobal(selected, p.folder, state.file.Name, state.block.Offset, int(state.block.Size), state.block.Hash, 0, nil)
activity.done(selected) activity.done(selected)
if lastError != nil { if lastError != nil {
if debug {
l.Debugln("request:", p.folder, state.file.Name, state.block.Offset, state.block.Size, "returned error:", lastError)
}
continue continue
} }
@ -1192,6 +1195,9 @@ func (p *rwFolder) pullerRoutine(in <-chan pullBlockState, out chan<- *sharedPul
// try pulling it from another device. // try pulling it from another device.
_, lastError = scanner.VerifyBuffer(buf, state.block) _, lastError = scanner.VerifyBuffer(buf, state.block)
if lastError != nil { if lastError != nil {
if debug {
l.Debugln("request:", p.folder, state.file.Name, state.block.Offset, state.block.Size, "hash mismatch")
}
continue continue
} }