]> granicus.if.org Git - transmission/commitdiff
(libT) when announcing a magnet link for the first time, send 'left=0'
authorJordan Lee <jordan@transmissionbt.com>
Wed, 30 Jan 2013 19:59:55 +0000 (19:59 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Wed, 30 Jan 2013 19:59:55 +0000 (19:59 +0000)
libtransmission/announcer.c

index 09ac7276439a4c1d5e011bb1efe4497d17078cd1..9d27e7d0220754a4941a555dc032dc8bb8a8e2cc 100644 (file)
@@ -920,7 +920,7 @@ announce_request_new (const tr_announcer  * announcer,
     req->corrupt = tier->byteCounts[TR_ANN_CORRUPT];
     req->leftUntilComplete = tr_torrentHasMetadata (tor)
             ? tor->info.totalSize - tr_cpHaveTotal (&tor->completion)
-            : ~ (uint64_t)0;
+            : 0;
     req->event = event;
     req->numwant = event == TR_ANNOUNCE_EVENT_STOPPED ? 0 : NUMWANT;
     req->key = announcer->key;
@@ -1206,6 +1206,24 @@ announce_request_delegate (tr_announcer               * announcer,
 {
     tr_session * session = announcer->session;
 
+#if 0
+    fprintf (stderr, "ANNOUNCE: event %s isPartialSeed %d port %d key %d numwant %d"
+                     " up %"PRIu64" down %"PRIu64" corrupt %"PRIu64" left %"PRIu64
+                     " url [%s] tracker_id_str [%s] peer_id [%8.8s]\n",
+             tr_announce_event_get_string (request->event),
+             (int)request->partial_seed,
+             (int)request->port,
+             request->key,
+             request->numwant,
+             request->up,
+             request->down,
+             request->corrupt,
+             request->leftUntilComplete,
+             request->url,
+             request->tracker_id_str,
+             request->peer_id);
+#endif
+
     if (!memcmp (request->url, "http", 4))
         tr_tracker_http_announce (session, request, callback, callback_data);
     else if (!memcmp (request->url, "udp://", 6))