Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #267: New binary to parse torrent files (only for debugging pur…
…poses) d9cdd65 feat: new binary to par torrent files (Jose Celano) Pull request description: I'm trying to fix bug #266 When I try to upload this torrent: https://academictorrents.com/details/3cd18ff2d3eec881207dcc5ca5a2c3a2a3afe462 I get this error trying to parse it: ``` InvalidType("Invalid Type: sequence (expected: `field identifier`)") ``` I've tried to reproduce the error with a clean project: https://github.com/torrust/torrust-parse-torrent But It works. I've added a binary to reproduce the error in this project. You can run it with: ``` cargo run --bin parse_torrent ./tests/fixtures/torrents/MC_GRID.zip-3cd18ff2d3eec881207dcc5ca5a2c3a2a3afe462.torrent ``` Output: ```s Reading the torrent file ... Decoding torrent with standard serde implementation ... InvalidType("Invalid Type: sequence (expected: `field identifier`)") Error: Custom { kind: Other, error: "Error: invalid torrent!. Invalid Type: sequence (expected: `field identifier`)" } ``` I need more ideas about how to solve this bug. I've checked the dependencies, and It does not work even if I use the same "serde" dependencies in this project. The torrent only has two different things: - The "pieces" field is big. - It has an extra field from BEP 19. I only have two more things to test: - ~~Create another torrent with a big "pieces" field. Only to check if the size is the problem~~. DONE. - Clone the "serve" crate and try to debug the code. I think the error is thrown [here](https://github.com/serde-rs/serde/blob/dad15b9fd0bef97b7a7c90a8a165b6ffbc682cae/serde/src/de/mod.rs#L1646). It seems the deserializer is expecting a file identifier (I guess for a Dictionary) and is getting a sequence. Top commit has no ACKs. Tree-SHA512: c9f02021801d492e34b7550662cfb6747bbf81f3724c3afdd3d92e22061066c400b721f35e80100d3253ff79fbda10d0bf0f7ea29df964f57ee97a1607b50fd3
- Loading branch information