Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout in getc should be treated as a NAK and cause a resend #12

Merged
merged 1 commit into from
Mar 17, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions xmodem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ def callback(total_packets, success_count, error_count)
if callable(callback):
callback(total_packets, success_count, error_count)
break
if char == NAK:
self.log.warn('send error: NAK received '
else:
self.log.warn('send error: non-ACK received '
'for block %d', sequence)
error_count += 1
if callable(callback):
Expand All @@ -328,12 +328,6 @@ def callback(total_packets, success_count, error_count)
# return to loop and resend
continue

# protocol error
self.log.error('send error: expected ACK, NAK; got %r, '
'aborting.', char)
self.abort(timeout=timeout)
return False

# keep track of sequence
sequence = (sequence + 1) % 0x100

Expand Down