Skip to content
Snippets Groups Projects
Commit 1bcc9174 authored by rswindell's avatar rswindell
Browse files

Log warning if streaming disabled in zmodem_send_file().

zmodem_send_from() returns immediately if it receives anything other than a
ZACK in response to a ZCRCW subpacket.
parent 5e6b4b37
No related branches found
No related tags found
No related merge requests found
...@@ -1387,15 +1387,13 @@ int zmodem_send_from(zmodem_t* zm, FILE* fp, ulong pos, ulong fsize, ulong* sent ...@@ -1387,15 +1387,13 @@ int zmodem_send_from(zmodem_t* zm, FILE* fp, ulong pos, ulong fsize, ulong* sent
int type; int type;
while(is_connected(zm) && !zm->cancelled) { while(is_connected(zm) && !zm->cancelled) {
type = zmodem_recv_header(zm); type = zmodem_recv_header(zm);
if(type == ZNAK || type == ZRPOS || type == TIMEOUT) { if(type != ZACK)
return type; return(type);
}
if(type == ZACK) { if(zm->rxd_header_pos == ftell(fp))
if(zm->rxd_header_pos == ftell(fp)) break;
break; lprintf(zm,LOG_WARNING,"ZACK for incorrect offset (%lu vs %lu)"
lprintf(zm,LOG_WARNING,"ZACK for incorrect offset (%lu vs %lu)" ,zm->rxd_header_pos, ftell(fp));
,zm->rxd_header_pos, ftell(fp));
}
} }
if((ulong)ftell(fp) >= fsize) { if((ulong)ftell(fp) >= fsize) {
...@@ -1462,6 +1460,9 @@ BOOL zmodem_send_file(zmodem_t* zm, char* fname, FILE* fp, BOOL request_init, ti ...@@ -1462,6 +1460,9 @@ BOOL zmodem_send_file(zmodem_t* zm, char* fname, FILE* fp, BOOL request_init, ti
zm->file_skipped=FALSE; zm->file_skipped=FALSE;
if(zm->no_streaming)
lprintf(zm,LOG_WARNING,"Streaming disabled");
if(request_init) { if(request_init) {
for(errors=0; errors<=zm->max_errors && !zm->cancelled && is_connected(zm); errors++) { for(errors=0; errors<=zm->max_errors && !zm->cancelled && is_connected(zm); errors++) {
lprintf(zm,LOG_INFO,"Sending ZRQINIT (%u of %u)" lprintf(zm,LOG_INFO,"Sending ZRQINIT (%u of %u)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment