So, the way retries normally should work is this:
1. Host sends block x
2. Client has a problem with block x, sends NAK and x
3. Host re-sends block x
4. Client likes block x, sends ACK and x+1.
And you have several locations in your log where individual packets are
bad, and it recovers normally.
What's happening at the end of your log is this:
1. Host sends block x
2. Client has a problem with block x, sends NAK and x+1
[This makes no sense; if the client doesn't like the block, it's not
supposed to increment the requested block!]
3. Host balks, re-sends block x
4. Client has a problem with block x, sends NAK and x+2
[Now we're really off the rails, hilarity ensues]
So now I'm stepping through the code trying to figure out what kind of
path could have been taken where it is sending a nak, but still got the
block counter incremented along the way. My initial guess is it's a
noisy packet that it's believing part of, and not heeding (or setting) a
carry flag as error indicator in an obscure error path.
When you said earlier that it "crashes," is it literally crashing to the
monitor - or is it at least stopping the transfer?