Commits (1)
  • Rob Swindell's avatar
    Allow local abort/cancel to abort (more) retries/loops · 312daa40
    Rob Swindell authored
    While debugging a SyncTERM upload issue, I came across some scenarios where an out of control file transfer could not be aborted via local key press (e.g. Ctrl-C, Ctrl-Break).
    
    We use zm.local_abort for all local abort indications (even for X/YMODEM). <shrug>
    312daa40
......@@ -1094,7 +1094,7 @@ static int receive_files(char** fname_list, int fnames)
outbuf.highwater_mark=0; /* don't delay ACK/NAK transmits */
/* Purge input buffer */
while(is_connected(NULL) && (i=recv_byte(NULL,0))!=NOINP)
while(is_connected(NULL) && (i=recv_byte(NULL,0))!=NOINP && !zm.local_abort)
lprintf(LOG_WARNING,"Throwing out received: %s",chr((uchar)i));
while(is_connected(NULL)) {
......
/* Synchronet X/YMODEM Functions */
/* Synchronet X/YMODEM Functions */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
......@@ -122,6 +121,8 @@ int xmodem_put_nak(xmodem_t* xm, unsigned block_num)
lprintf(xm,LOG_DEBUG,"Block %u: Dumping byte: %02Xh"
,block_num, (BYTE)i);
SLEEP(1);
if(is_cancelled(xm))
break;
}
if(dump_count)
lprintf(xm,LOG_INFO,"Block %u: Dumped %u bytes"
......@@ -436,7 +437,7 @@ BOOL xmodem_put_eot(xmodem_t* xm)
unsigned errors;
unsigned cans=0;
for(errors=0;errors<=xm->max_errors && is_connected(xm);errors++) {
for(errors=0;errors<=xm->max_errors && is_connected(xm) && !is_cancelled(xm);errors++) {
lprintf(xm,LOG_INFO,"Sending End-of-Text (EOT) indicator (%d)",errors+1);
......