Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Handle corupted pieces in a handle status #7982

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Commits on Apr 22, 2024

  1. Enhance test readability with helper function

    Introduced a helper function to improve the readability of tests in the libtorrent component. This function converts bitarray representations into base64, making it easier to understand and verify the expected results. The changes are applied in tests that check if correct pieces bitmask is returned when requested.
    drew2a committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    9eac127 View commit details
    Browse the repository at this point in the history
  2. Improve error handling in piece bitmask generation

    Adjusted the method for generating a base64 encoded bitmask of downloaded pieces. Now, it includes a try-except block to handle potential ValueError exceptions that could occur if the list of pieces is corrupted. This change ensures that an empty string is returned instead of allowing the exception to propagate. Additionally, a corresponding test case has been added to verify this new behavior when dealing with corrupted piece lists.
    drew2a committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    0ef78af View commit details
    Browse the repository at this point in the history