Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit fba33a15 authored by rswindell's avatar rswindell

Fix a 14-year old bug with ZMODEM-send. If the receiver already has the

file named in the ZFILE frame, they will usually compute the local CRC
value and request the sender to compute and send its CRC of the file it
wants to send. If the CRCs match, the receiver will send a ZSKIP frame
next ("skip this file, I already have it"). However, when I implemented
the ZCRC frame support in zmodem_send_file(), I added the ZCRC frame
check *after* the check to see if its a ZSKIP frame, when in fact, they
will normally come in the other order (ZCRC, then ZSKIP). This would result
in multiple ZCRC request/response, then ZSKIP requests that were ignored
by the sender (who just send a ZFILE frame again). Simple fix: check for
ZCRC frame before ZSKIP frame.
parent 6222d5a5
......@@ -191,7 +191,7 @@ static char* frame_desc(int frame)
break;
}
} else
sprintf(str,"%d",frame);
return chr(frame);
return(str);
}
......@@ -1826,12 +1826,6 @@ BOOL zmodem_send_file(zmodem_t* zm, char* fname, FILE* fp, BOOL request_init, ti
lprintf(zm,LOG_INFO,"type : %d",type);
#endif
if(type == ZSKIP) {
zm->file_skipped=TRUE;
lprintf(zm,LOG_WARNING,"File skipped by receiver");
return(TRUE);
}
if(type == ZCRC) {
if(zm->crc_request==0)
lprintf(zm,LOG_NOTICE,"Receiver requested CRC of entire file");
......@@ -1842,6 +1836,12 @@ BOOL zmodem_send_file(zmodem_t* zm, char* fname, FILE* fp, BOOL request_init, ti
type = zmodem_recv_header(zm);
}
if(type == ZSKIP) {
zm->file_skipped=TRUE;
lprintf(zm,LOG_WARNING,"File skipped by receiver");
return(TRUE);
}
if(type == ZRPOS)
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment