Skip to content

Bug fix in SftpFileWriter and increased version constraints #104

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 3 commits into from

Conversation

obemu
Copy link

@obemu obemu commented Jul 30, 2024

  • Bumped SDK constraints from ">=2.17.0 <3.0.0" up to ">=2.17.0 <4.0.0"

  • Bug fix in SftpFileWriter for #50, #71, #100:

    When the input stream contains only one event and that event has fewer bytes than maxBytesOnTheWire, then the SftpFileWriter._doneCompleter never got completed. This happened because the completer got only completed in the _handleLocalData event handler if the _streamDone flag was already true, the problem is that if the stream only has one small event, then _handleLocalData will only be called once with the event and afterward _handleLocalDone will be called once, which sets _streamDone to true. At this point the _doneCompleter cannot be completed anymore because the _handleLocalData will not get called anymore. This problem causes never ending await statements when opening and writing a file.

    This issue has been fixed by checking if all sent bytes have already been acknowledged in the _handleLocalDone event handler and subsequently completing the _doneCompleter.

      void _handleLocalDone() {
        _streamDone = true;
        if (_bytesSent == _bytesAcked) {
          _doneCompleter.complete();
        }
      }
  • Added return type SftpFileOpenMode to operator | in class SftpFileOpenMode. Fix for #80.

obemu added 2 commits July 30, 2024 15:48
* Updated pubspec.yaml and README.md to point to new github repository

* Edited README.md
@vicajilau
Copy link
Collaborator

Thank you very much for your time in helping with this project. This has been integrated into a larger PR.

@vicajilau vicajilau closed this Aug 29, 2024
@TerminalStudio TerminalStudio deleted a comment from obemu Aug 29, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants