[SPAM] [BitTorrent] 1. patch for track.py

Denis Ahrens denis at berlin.ccc.de
Thu Nov 18 17:03:11 EST 2004


Hi

This patch fixes which NEVER worked at all. So it seems that nobody is 
using the python
tracker which is very sad. I like it because I can implement all the 
things I need! ;)

It fixes the options --infopage_redirect, --show_infopage and 
--scrape_allowed

I think the option --show_infopage is redundant. It is not needed 
without
--show_infopage. I would like to remove it. Should I write a patch for 
it?

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 21:50:32 -0000
@@ -123,6 +123,9 @@
          self.reannounce_interval = config['reannounce_interval']
          self.save_dfile_interval = config['save_dfile_interval']
          self.show_names = config['show_names']
+        self.show_infopage = config['show_infopage']
+        self.infopage_redirect = config['infopage_redirect']
+        self.scrape_allowed = config['scrape_allowed']
          self.only_local_override_ip = config['only_local_override_ip']
          favicon = config['favicon']
          self.favicon = None
@@ -194,9 +197,9 @@
          self.keep_dead = config['keep_dead']

      def get_infopage(self):
-        if not self.config['show_infopage']:
+        if not self.show_infopage:
              return (404, 'Not Found', {'Content-Type': 'text/plain', 
'Pragma': 'no-cache'}, alas)
-        red = self.config['infopage_redirect']
+        red = self.infopage_redirect
          if red != '':
              return (302, 'Found', {'Content-Type': 'text/html', 
'Location': red},
                      '<A HREF="'+red+'">Click Here</A>')
@@ -298,7 +301,7 @@
      def get_scrape(self, paramslist):
          fs = {}
          if paramslist.has_key('info_hash'):
-            if self.config['scrape_allowed'] not in ['specific', 
'full']:
+            if self.scrape_allowed not in ['specific', 'full']:
                  return (400, 'Not Authorized', {'Content-Type': 
'text/plain', 'Pragma': 'no-cache'},
                      bencode({'failure reason':
                      'specific scrape function is not available with 
this tracker.'}))
@@ -306,7 +309,7 @@
                  if infohash in self.downloads.keys():
                      fs[infohash] = self.scrapedata(infohash)
          else:
-            if self.config['scrape_allowed'] != 'full':
+            if self.scrape_allowed != 'full':
                  return (400, 'Not Authorized', {'Content-Type': 
'text/plain', 'Pragma': 'no-cache'},
                      bencode({'failure reason':
                      'full scrape function is not available with this 
tracker.'}))




------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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