-
Notifications
You must be signed in to change notification settings - Fork 29
/
anatomy.php
99 lines (94 loc) · 6.27 KB
/
anatomy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/*
// +--------------------------------------------------------------------------+
// | Project: TBDevYSE - TBDev Yuna Scatari Edition |
// +--------------------------------------------------------------------------+
// | This file is part of TBDevYSE. TBDevYSE is based on TBDev, |
// | originally by RedBeard of TorrentBits, extensively modified by |
// | Gartenzwerg. |
// | |
// | TBDevYSE is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | TBDevYSE is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with TBDevYSE; if not, write to the Free Software Foundation, |
// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
require "include/bittorrent.php";
dbconn(false);
stdhead("Àíàòîìèÿ BitTorrent");
?>
<table class=main width=750 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>
<table width=100% border=1 cellspacing=0 cellpadding=5>
<tr><td class=colhead>Àíàòîìèÿ òîððåíò-ñåñèè</td></tr>
<tr><td class=text>
<em>(Updated to reflect the tracker changes. 14-04-2004)</em>
<br /><br />
There seems to be a lot of confusion about how the statistics updates work. The following is a capture of a full
session to see what's going on behind the scenes. Êëèåíò îáùàåòñÿ ñ òðåêåðîì ÷åðåç ïðîñòîé HTTP GET-çàïðîñ. Ðàñìîòðèì ñàìûé ïðîñòîé ñëó÷àé:<br />
<br />
<code>GET /announce.php?<b>passkey</b>=a092924c51e9cac0d76b51457de93c9e&<b>info_hash</b>=c%97%91%C5jG%951%BE%C7M%F9%BFa%03%F2%2C%ED%EE%0F& <b>peer_id</b>=S588-----gqQ8TqDeqaY&<b>port</b>=6882&<b>uploaded</b>=0&<b>downloaded</b>=0&<b>left</b>=753690875&<b>event</b>=started</code><br />
<br />
Ðàçáèðàåì íà ÷àñòè:<br />
<br />
• <b>passkey</b> - âàø ëè÷íûé ïàñêåé, êîòîðûé èäåíòèôèöèðóåò âàñ êàê ïîëüçîâàòåëÿ òðåêåðà<br />
• <b>info_hash</b> - õåø èäåíòèôèöèðóþùèé òîððåíò<br />
• <b>peer_id</b> - èäåíòèôèêàòîð êëèåíòà (÷àñòü s588 îçíà÷àåò Shad0w's 5.8.8, îñòàëüíîå ñëó÷àéíûå ÷èñëà)<br />
• <b>port</b> - ïîðò íà êîòîðîì êëèåíò ñëóøàåò âõîäÿùèå ñîåäèíåíèÿ<br />
• <b>uploaded</b>=0 - ñêîëüêî êëèåíò îòäàë èíôîðìàöèè<br />
• <b>downloaded</b>=0 - ñêîëüêî êëèåíò ñêà÷àë èíôîðìàöèè<br />
• <b>left</b>=753690875 - ñêîëüêî îñòàëîñü çàêà÷àòü<br />
• <b>event=started</b> - ñîîáùåíèå òðåêåðó î òîì ÷òî êëèåíò òîëüêî íà÷àë çàêà÷êó<br />
<br />
Îáðàòèòå âíèìàíèå, ÷òî IP àäðåñ ïîëüçîâàòåëÿ òóò íå ïåðåäàåòñÿ (òåì íå ìåíåå êëèåíò ìîæåò áûòü íàñòðîåí íà ïåðåäà÷ó IP àäðåñà).
It's up to the tracker to see it and associate it with the user_id.<br />
(Îòâåòû ñåðâåðà îïóùåíû, â íèõ íàõîäèòüñÿ òîëüêî IP àäðåñà ïèðîâ è ñîòâåñòâóþùèå ïîðòû.)<br />
At this stage the user's profile will be listing this torrent as being leeched.<br />
<br />
» Ñ ýòîãî ìîìåíòà êëèåíò áóäåò îòïðàâëÿòü GET-çàïðîñû íà òðåêåð. Ìû ðàñìîòðèì òîëüêî ïåðâûé èç íèõ:
<br />
<br />
<code> GET /announce.php?<b>passkey</b>=a092924c51e9cac0d76b51457de93c9e&<b>info_hash</b>=c%97%91%C5jG%951%BE%C7M%F9%BFa%03%F2%2C%ED%EE%0F& <b>peer_id</b>=S588-----gqQ8TqDeqaY&<b>port</b>=6882&<b>uploaded</b>=67960832&<b>downloaded</b>=40828928& <b>left</b>=715417851&<b>numwant</b>=0</code><br />
<br />
("numwant" is how the client tells the tracker how many new peers it wants, in this case 0.)
<br />
<br />
As you can see at this stage the user had uploaded approx. 68MB and downloaded approx. 40MB. Whenever the tracker receives
these GETs it updates both the stats relative to the 'currently leeching/seeding' boxes and the total user upload/download stats. These intermediate GETs will be sent either periodically (every 15 min
or so, depends on the client and tracker) or when you force a manual announce in the client.
<br />
<br />
Íàêîíåö, êîãäà êëèåíò çàêðûâàåòüñÿ îí îòïðàâëÿåò åùå îäèí çàïðîñ íà òðåêåð:
<br />
<br />
<code> GET /announce.php?<b>passkey</b>=a092924c51e9cac0d76b51457de93c9e&<b>info_hash</b>=c%97%91%C5jG%951%BE%C7M%F9%BFa%03%F2%2C%ED%EE%0F& <b>peer_id</b>=S588-----gqQ8TqDeqaY&<b>port</b>=6882&<b>uploaded</b>=754384896&<b>downloaded</b>=754215163 &<b>left</b>=0&numwant</b>=0&<b>event</b>=completed</code><br />
<br />
Notice the all-important "event=completed". It is at this stage that the torrent will be removed from the user's profile.
If for some reason (tracker down, lost connection, bad client, crash, ...) this last GET doesn't reach
the tracker this torrent will still be seen in the user profile until some tracker timeout occurs. It should be stressed that this message will be sent only when
closing the client properly, not when the download is finished. (The tracker will start listing
a torrent as 'currently seeding' after it receives a GET with left=0). <br />
<br />
There's a further message that causes the torrent to be removed from the user's profile,
namely "event=stopped". This is usually sent
when stopping in the middle of a download, e.g. by pressing 'Cancel' in Shad0w's. <br />
<br />
Åùå îäíà çàìåòêà: íåêîòîðûå êëèåíòû èìåþò ôóíêöèþ ïàóçà/ïðîäîëæèòü. Ýòî <b>íå</b> îòïðàâëÿåò íèêàêîãî ñîîáùåíèÿ íà ñåðâåð.
Íå èñïîëüçóéòå ýòî êàê ïîïûòêó îáíîâëÿòü ñòàòèñòêó ÷àùå, ýòî ïðîñòî íå áóäåò ðàáîòàòü. (Ïðîâåðåíî íà Shad0w's 5.8.11 è ABC 2.6.5.)
<br />
</td></tr></table>
</td></tr></table>
<br />
<?
stdfoot();
?>