Skip to content
Snippets Groups Projects
Commit 0e8184c8 authored by deuce's avatar deuce
Browse files

Auto-fallback to 128 byte blocks after three failures to send block one.

parent d11ec1d4
No related branches found
No related tags found
No related merge requests found
......@@ -499,6 +499,10 @@ BOOL xmodem_send_file(xmodem_t* xm, const char* fname, FILE* fp, time_t* start,
xm->errors++;
lprintf(xm,LOG_WARNING,"Error #%d at offset %ld"
,xm->errors,ftell(fp)-xm->block_size);
if(xm->errors==3 && block_num==1 && xm->block_size>128) {
lprintf(xm,LOG_NOTICE,"Falling back to 128 byte blocks");
xm->block_size=128;
}
} else {
block_num++;
sent_bytes+=rd;
......
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