Commit add7bab0 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Treat 0-byte QW* files the same as non-existent

The SBBS event_thread ignores 0-byte QW* files, so we should here as well
(just overwrite them if they exist), otherwise, if 10 0-byte QW* files got
created, we would just stop downloading QWK packets indefinitely.

Fixes issue reported by deon (ALTERANT) on DOVE-Net.
parent f3ec8613
// $Id: qnet-ftp.js,v 1.4 2020/05/22 06:58:34 rswindell Exp $
//****************************************************************************
// JavaScript module for performing FTP-based QWKnet call-outs
// Inspired by exec/qnet-ftp.src
......@@ -8,7 +7,7 @@
// Usage: ?qnet-ftp <hub-id> [address] [password] [port]
// Example: ?qnet-ftp VERT vert.synchro.net YOURPASS 21
const REVISION = "$Revision: 1.4 $".split(' ')[1];
const REVISION = "1.5";
require('ftp.js', 'FTP');
......@@ -30,11 +29,11 @@ var qwk_fname = system.data_dir + qwk;
log(LOG_DEBUG, js.exec_file + " v" + REVISION);
if(file_getcase(qwk_fname)) {
if(file_size(qwk_fname) > 0) {
alert(qwk_fname + " already exists");
for(var i = 0; ; i++) {
qwk_fname = system.data_dir + hubid + ".qw" + i;
if(!file_getcase(qwk_fname))
if(file_size(qwk_fname) < 1)
break;
alert(qwk_fname + " already exists");
if(i == 9)
......
Supports Markdown
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