handleEpsv method
Implementation
Future<void> handleEpsv(String argument, FtpSession session) async {
if (argument.toUpperCase() == 'ALL') {
// RFC 2428 ยง4: after EPSV ALL, server must refuse PORT/PASV/LPRT
session.epsvAllMode = true;
session.sendResponse('200 EPSV ALL command successful');
} else if (argument.isEmpty || argument == '1') {
// Empty = server chooses; '1' = IPv4
await session.enterExtendedPassiveMode();
} else if (argument == '2') {
// IPv6 not supported
session.sendResponse('522 Network protocol not supported, use (1)');
} else {
session.sendResponse('501 Syntax error in parameters');
}
}