crifurch / pure_ftp

MIT License
6 stars 3 forks source link

FormatException #12

Closed b3lon9 closed 1 month ago

b3lon9 commented 1 month ago

hi crifurch, I used your package. find one bug.

I want process to upload local file into FTP Server(Ubuntu). but EPSV state do not work.

so I look your source and find bug.

file path : data_parser_utils.dart, line:28 _parseProtEPSV

message not applied change substring message.

  static int _parsePortEPSV(FtpResponse response) {
    final message = response.message;
    final iParOpen = message.indexOf('(');
    final iParClose = message.indexOf(')');

    if (iParClose > -1 && iParOpen > -1) {
      message.substring(iParOpen + 4, iParClose - 1);
    }
    return int.parse(message);
  }

change

  static int _parsePortEPSV(FtpResponse response) {
    String message = response.message;
    final iParOpen = message.indexOf('(');
    final iParClose = message.indexOf(')');

    if (iParClose > -1 && iParOpen > -1) {
      message = message.substring(iParOpen + 4, iParClose - 1);
    }
    return int.parse(message);
  }
crifurch commented 1 month ago

@b3lon9 thanks for your work, i will fix it in few hours