Skip to content

Commit

Permalink
Merge #316: User forked version of serde-bencode
Browse files Browse the repository at this point in the history
3550c44 fix: [#226] user serde-bencode v0.2.4 (Jose Celano)

Pull request description:

  Using our crate `torrust-serde-bencode` instead of the upstream repo fixes the problem with some torrent deserializations described in this [issue](#266).

  There was a problem with lists (field `nodes` in the torrent) containing other lists (tuples) with different value types.

  ```json
  {
     "info": {
        "length": 8,
        "name": "minimal.txt",
        "piece length": 16384,
        "pieces": "<hex>30 9A 84 51 4A F1 09 D0 8C 34 42 11 26 67 7F 84 B3 23 4D 78</hex>"
     },
     "nodes": [
        [
           "188.163.121.224",
           56711
        ],
        [
           "162.250.131.26",
           13386
        ]
     ]
  }
  ```

  I have been trying to reproduce the bug in our fork [here](torrust/torrust-serde-bencode-archive#12), but it works. I've added a test using the same torrent file that does not work here.

  If you run:

  ```console
  cargo run --bin parse_torrent ./tests/fixtures/torrents/not-working-with-two-nodes.torrent
  ```

  With the current `develop` branch, you'll see that it does **NOT** work. But It works using our fork.

  For this PR, I have changed the `cargo.toml` file to include the latest commit from the fork. And it works.

  Surprisingly, it also works with:

  ```toml
  torrust-serde-bencode = "^0.2.3"
  ```

  Which was supposed to be the same code as:

  ```toml
  serde_bencode = "^0.2.3"
  ```

  So, no idea why it's working with an almost-exact copy of the original package.

  Anyway, `serde_bencode` is not maintained. So I'll will:

  - Publish a new version for `torrust-serde-bencode`.
  - Change this PR to use the new version `torrust-serde-bencode = "^0.2.4"`.

ACKs for top commit:
  josecelano:
    ACK 3550c44

Tree-SHA512: 374a95b6315079a4efd7ff9768cecfe21cfc0ee53c4f0cc5d326aa473c66cff5d2a09a91d0521831cc779651d31e5483b1ea8373eb773dd63b7e33ae34737868
  • Loading branch information
josecelano committed Oct 27, 2023
2 parents db99842 + 3550c44 commit b331eaf
Show file tree
Hide file tree
Showing 2 changed files with 171 additions and 135 deletions.
Loading

0 comments on commit b331eaf

Please sign in to comment.