diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 60e1999d..d83f133c 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -26,8 +26,6 @@ const WTVClientCapabilities = require(classPath + "/WTVClientCapabilities.js"); const WTVClientSessionData = require(classPath + "/WTVClientSessionData.js"); const WTVMime = require(classPath + "/WTVMime.js"); const WTVFlashrom = require(classPath + "/WTVFlashrom.js"); -const WTVFTP = require(classPath + "/WTVFTP.js"); -const WTVPNM = require(classPath + "/WTVPNM.js"); const vm = require('vm'); const debug = require('debug')('app'); const express = require('express'); @@ -1195,10 +1193,9 @@ minisrv-no-mail-count: true`; handlerModules["wtvhttp"].doHTTPProxy(socket, request_headers); } else if (handlerModules["wtvgopher"] && shortURL.startsWith("gopher://")) { handlerModules["wtvgopher"].handleGopherRequest(socket, request_headers, wtvshared, sendToClient); - } else if (shortURL.startsWith('ftp://')) { + } else if (handlerModules["wtvftp"] &&shortURL.startsWith('ftp://')) { if (minisrv_config.config.debug_flags.show_headers) console.debug(" * Incoming FTP request on WTVP socket ID", socket.id, await wtvshared.decodePostData(await wtvshared.filterRequestLog(await wtvshared.filterSSID(request_headers)))); - const wtvftp = new WTVFTP(wtvshared, sendToClient); - wtvftp.handleFTPRequest(socket, request_headers); + handlerModules["wtvftp"].handleFTPRequest(socket, request_headers); } else if (shortURL.indexOf('file://') >= 0) { shortURL = shortURL.replace("file://",'').replace("romcache", "ROMCache"); service_name = "wtv-star"; diff --git a/zefie_wtvp_minisrv/includes/classes/WTVFTP.js b/zefie_wtvp_minisrv/includes/classes/WTVFTP.js index a13642ed..df2d16e0 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVFTP.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVFTP.js @@ -9,7 +9,7 @@ class WTVFTP { ftp = null; url = null; - constructor(minisrv_config, sendToClient) { + constructor(minisrv_config, service_name, sendToClient) { this.minisrv_config = minisrv_config; this.sendToClient = sendToClient; const WTVShared = require("./WTVShared.js")['WTVShared']; diff --git a/zefie_wtvp_minisrv/includes/config.json b/zefie_wtvp_minisrv/includes/config.json index e5e68bec..0fd9abb6 100644 --- a/zefie_wtvp_minisrv/includes/config.json +++ b/zefie_wtvp_minisrv/includes/config.json @@ -301,7 +301,9 @@ }, "ftp": { "port": 1650, - "connections": 3 + "connections": 3, + "handler_module": "WTVFTP", + "handler_extra_vars": ["sendToClient"] }, "http": { // http upstream