update WTVFTP to new module system
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -301,7 +301,9 @@
|
||||
},
|
||||
"ftp": {
|
||||
"port": 1650,
|
||||
"connections": 3
|
||||
"connections": 3,
|
||||
"handler_module": "WTVFTP",
|
||||
"handler_extra_vars": ["sendToClient"]
|
||||
},
|
||||
"http": {
|
||||
// http upstream
|
||||
|
||||
Reference in New Issue
Block a user