Skip to content
Snippets Groups Projects
Commit 6e7012ab authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix failure to recognize remote cancel if send buffer full.

xmodem_cancel() would return an error if putcom() failed, *before*
setting the "cancelled" [sic] flag. xmodem_cancel() in response to the
receipt of a remote cancel request (^X character).
parent 3447610c
No related branches found
No related tags found
No related merge requests found
......@@ -167,13 +167,13 @@ int xmodem_cancel(xmodem_t* xm)
int result;
if(!is_cancelled(xm) && is_connected(xm)) {
xm->cancelled=TRUE;
for(i=0;i<8 && is_connected(xm);i++)
if((result=putcom(CAN))!=0)
return result;
for(i=0;i<10 && is_connected(xm);i++)
if((result=putcom('\b'))!=0)
return result;
xm->cancelled=TRUE;
}
xmodem_flush(xm);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment