Author: poeml Date: Sat Sep 25 04:10:19 2010 New Revision: 8157 URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8157&view=rev Log: mod_mirrorbrain: - The Torrent info dictionary should be sorted lexicographically for some clients (rtorrent). The specification seems to require this, too. Issue #78 should be fixed regarding the info dictionary now. Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.c?rev=8157&r1=8156&r2=8157&view=diff ============================================================================== --- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original) +++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Sat Sep 25 04:10:19 2010 _at_@ -2832,24 +2832,23 @@ ap_rprintf(r, "4:info" "d" "6:length" - "i%se" - "4:name" + "i%se", + apr_off_t_toa(r->pool, r->finfo.size)); + ap_rprintf(r, "6:md5sum" + "%d:%s", MD5_DIGESTSIZE * 2, hashbag->md5hex); + ap_rprintf(r, "4:name" "%d:%s" "12:piece length" "i%de" "6:pieces" - "%d:", apr_off_t_toa(r->pool, r->finfo.size), - strlen(basename), + "%d:", strlen(basename), basename, hashbag->sha1piecesize, (hashbag->sha1pieceshex->nelts * SHA1_DIGESTSIZE)); - char **p = (char **)hashbag->sha1pieceshex->elts; for (i = 0; i < hashbag->sha1pieceshex->nelts; i++) { ap_rwrite(hex_decode(r, p[i], SHA1_DIGESTSIZE), SHA1_DIGESTSIZE, r); } - ap_rprintf(r, "6:md5sum" - "%d:%s", MD5_DIGESTSIZE * 2, hashbag->md5hex); ap_rprintf(r, "4:sha1" "%d:", SHA1_DIGESTSIZE); ap_rwrite( hex_decode(r, hashbag->sha1hex, SHA1_DIGESTSIZE), _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Sat Sep 25 2010 - 02:10:21 GMT
This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT