merge http scrape fix from RC_1_0

This commit is contained in:
arvidn 2015-06-18 01:05:36 -04:00
parent 6cf9965416
commit 8959971dd3
3 changed files with 6 additions and 3 deletions

View File

@ -71,6 +71,7 @@
* almost completely changed the storage interface (for custom storage)
* added support for hashing pieces in multiple threads
* fix http scrape
* add missing port mapping functions to python binding
* fix bound-checking issue in bdecoder
* expose missing dht_settings fields to python

View File

@ -114,6 +114,9 @@ namespace libtorrent
else
url += "?";
url += "info_hash=";
url += escape_string((const char*)&tracker_req().info_hash[0], 20);
if (tracker_req().kind == tracker_request::announce_request)
{
const char* event_string[] = {"completed", "started", "stopped", "paused"};
@ -121,8 +124,7 @@ namespace libtorrent
char str[1024];
const bool stats = tracker_req().send_stats;
snprintf(str, sizeof(str)
, "info_hash=%s"
"&peer_id=%s"
, "&peer_id=%s"
"&port=%d"
"&uploaded=%" PRId64
"&downloaded=%" PRId64
@ -133,7 +135,6 @@ namespace libtorrent
"&numwant=%d"
"&compact=1"
"&no_peer_id=1"
, escape_string((const char*)&tracker_req().info_hash[0], 20).c_str()
, escape_string((const char*)&tracker_req().pid[0], 20).c_str()
// the i2p tracker seems to verify that the port is not 0,
// even though it ignores it otherwise

View File

@ -44,6 +44,7 @@ POSSIBILITY OF SUCH DAMAGE.
using namespace libtorrent;
namespace lt = libtorrent;
// TODO: test scrape requests
// TODO: test parse peers6
// TODO: test parse tracker-id
// TODO: test parse failure-reason