[BitTorrent] 3. patch for track.py

Denis Ahrens denis at berlin.ccc.de
Thu Nov 18 17:21:52 EST 2004


Hi

This patch fixes a rare bug. When the connection of a client breaks 
down before the
trackercode could get the source ip of it then the ip is saved as "no 
connection".
When this is save in the statefile the tracker cannot import the 
savefile properly
and all states are lost.

This is my fix for it. I don't know if it is the right way but at least 
it
should word and solve the problem.

Denis

Index: track.py
===================================================================
RCS file: /cvsroot/bittorrent/BitTorrent/BitTorrent/track.py,v
retrieving revision 1.96
diff -u -r1.96 track.py
--- track.py    4 Jun 2004 22:09:02 -0000       1.96
+++ track.py    18 Nov 2004 22:15:46 -0000
@@ -360,6 +360,8 @@
                      return (200, 'OK', {'Content-Type': 'text/plain', 
'Pragma': 'no-cache'}, bencode({'failure reason':
                      'Requested download is not authorized for use with 
this tracker.'}))
              ip = connection.get_ip()
+            if ip == 'no connection':
+                raise ValueError('Connection Lost')
              ip_override = 0
              if params.has_key('ip') and is_valid_ipv4(params['ip']) 
and (
                      not self.only_local_override_ip or 
is_local_ip(ip)):




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dkFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
    BitTorrent-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the BitTorrent mailing list