fix src/bdict.cc: dict keys should be sorted before encode#8
Conversation
| extern "C" { | ||
| #include "php.h" | ||
|
|
||
| //c func borrowed from https://github.com/php/php-src/blob/e08ce4c13db6e9aecd3497cd270b72d06c649bc7/ext/standard/array.c#L245 |
There was a problem hiding this comment.
Could you please add a space after // and format this file using clang-format? There is already a .clang-format in the project.
|
Ah, good spot. I actually didn't know the fact that 'there is only a single valid bencoding' and sorting keys of dictionaries is apparently needed for this. There is a minor formatting issue which I already pointed out above and it'd be nice if you could fix it and squash the commits. Thanks for the contribution. |
c56e1c2 to
b66d7d5
Compare
|
Yes, I didn't encounter any problems until one day , some users of Transmission reported to me that the torrent file downloaded can not be used because the private tracker server responsed with : torrent not registered on the server. then, I did some investigation and found that it is that the php extension we used which generated the wrong bittorrent file. this |
b66d7d5 to
af9d284
Compare
add tests/dict_ordered_keys.phpt
af9d284 to
20d4451
Compare
|
test added |
|
Thank you. I'll release a new version asap. |
|
thanks for the work. |
this may fixup issue: #7