pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/bittorrent update to 3.4.1



details:   https://anonhg.NetBSD.org/pkgsrc/rev/349c5be8e977
branches:  trunk
changeset: 470927:349c5be8e977
user:      recht <recht%pkgsrc.org@localhost>
date:      Fri Mar 12 23:43:05 2004 +0000

description:
update to 3.4.1

This version fixes lots of bugs, adds more bandwidth savings, and
improves support for peers behind dynamic IPs.

diffstat:

 net/bittorrent/Makefile         |   3 +-
 net/bittorrent/Makefile.common  |   4 +-
 net/bittorrent/distinfo         |   8 +--
 net/bittorrent/patches/patch-ac |  57 --------------------------
 net/bittorrent/patches/patch-ad |  87 -----------------------------------------
 5 files changed, 6 insertions(+), 153 deletions(-)

diffs (195 lines):

diff -r a89f04c17c07 -r 349c5be8e977 net/bittorrent/Makefile
--- a/net/bittorrent/Makefile   Fri Mar 12 23:40:24 2004 +0000
+++ b/net/bittorrent/Makefile   Fri Mar 12 23:43:05 2004 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.17 2004/03/09 10:26:59 recht Exp $
+# $NetBSD: Makefile,v 1.18 2004/03/12 23:43:05 recht Exp $
 #
 
 .include "Makefile.common"
 
 PKGNAME=       ${DISTNAME:S/BitT/bitt/}
-PKGREVISION=   1
 
 PYDISTUTILSPKG=        YES
 
diff -r a89f04c17c07 -r 349c5be8e977 net/bittorrent/Makefile.common
--- a/net/bittorrent/Makefile.common    Fri Mar 12 23:40:24 2004 +0000
+++ b/net/bittorrent/Makefile.common    Fri Mar 12 23:43:05 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.common,v 1.2 2004/03/07 21:25:33 recht Exp $
+# $NetBSD: Makefile.common,v 1.3 2004/03/12 23:43:05 recht Exp $
 #
 
-DISTNAME=      BitTorrent-3.4
+DISTNAME=      BitTorrent-3.4.1
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=bittorrent/}
 EXTRACT_SUFX=  .zip
diff -r a89f04c17c07 -r 349c5be8e977 net/bittorrent/distinfo
--- a/net/bittorrent/distinfo   Fri Mar 12 23:40:24 2004 +0000
+++ b/net/bittorrent/distinfo   Fri Mar 12 23:43:05 2004 +0000
@@ -1,8 +1,6 @@
-$NetBSD: distinfo,v 1.8 2004/03/09 10:26:59 recht Exp $
+$NetBSD: distinfo,v 1.9 2004/03/12 23:43:05 recht Exp $
 
-SHA1 (BitTorrent-3.4.zip) = 58b2a5884bcc71722f6c7332ec6e4b4ec086031e
-Size (BitTorrent-3.4.zip) = 242707 bytes
+SHA1 (BitTorrent-3.4.1.zip) = 2bbffc518ba23a4f821052bb0ea71135495a729a
+Size (BitTorrent-3.4.1.zip) = 244669 bytes
 SHA1 (patch-aa) = 8c3abb81127bda1594b944fd6e11f587e8477e87
 SHA1 (patch-ab) = 186ad86d153bc0c7a3e3234c03ec854b2325cb03
-SHA1 (patch-ac) = 6f95e52ea2dba423e904ebe2364ae44405ebe2f7
-SHA1 (patch-ad) = 9bd7d1e7cdab69a15ffcb98ad41f4840ba11e1e8
diff -r a89f04c17c07 -r 349c5be8e977 net/bittorrent/patches/patch-ac
--- a/net/bittorrent/patches/patch-ac   Fri Mar 12 23:40:24 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-$NetBSD: patch-ac,v 1.1 2004/03/09 10:33:22 recht Exp $
-
---- BitTorrent/RawServer.py.orig       2004-02-07 14:35:06.000000000 +0100
-+++ BitTorrent/RawServer.py    2004-03-09 11:11:09.000000000 +0100
-@@ -75,8 +75,12 @@
-         else:
-             self.raw_server.poll.register(self.socket, all)
- 
-+def default_error_handler(x):
-+    print x
-+
- class RawServer:
--    def __init__(self, doneflag, timeout_check_interval, timeout, noisy = True, errorfunc = None, maxconnects = 55):
-+    def __init__(self, doneflag, timeout_check_interval, timeout, noisy = True,
-+            errorfunc = default_error_handler, maxconnects = 55):
-         self.timeout_check_interval = timeout_check_interval
-         self.timeout = timeout
-         self.poll = poll()
-@@ -114,6 +118,10 @@
-         if reuse:
-             server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-         server.setblocking(0)
-+        try:
-+            server.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 32)
-+        except:
-+            pass
-         server.bind((bind, port))
-         server.listen(5)
-         self.poll.register(server, POLLIN)
-@@ -147,7 +155,6 @@
-                     try:
-                         newsock, addr = self.server.accept()
-                         newsock.setblocking(0)
--                        newsock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 32)
-                         if len(self.single_sockets) >= self.maxconnects:
-                             newsock.close()
-                             continue
-@@ -224,16 +231,16 @@
-                     if self.doneflag.isSet():
-                         return
-                     self._close_dead()
--                except error:
-+                except error, e:
-                     if self.doneflag.isSet():
-                         return
-                     # I can't find a coherent explanation for what the behavior should be here,
-                     # and people report conflicting behavior, so I'll just try all the possibilities
-                     try:
--                        code, msg, desc = error
-+                        code, msg, desc = e
-                     except:
-                         try:
--                            code, msg = error
-+                            code, msg = e
-                         except:
-                             code = ENOBUFS
-                     if code == ENOBUFS:
diff -r a89f04c17c07 -r 349c5be8e977 net/bittorrent/patches/patch-ad
--- a/net/bittorrent/patches/patch-ad   Fri Mar 12 23:40:24 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-$NetBSD: patch-ad,v 1.1 2004/03/09 10:33:22 recht Exp $
-
---- BitTorrent/track.py.orig   2004-02-26 05:06:06.000000000 +0100
-+++ BitTorrent/track.py        2004-03-09 11:11:03.000000000 +0100
-@@ -148,9 +148,9 @@
-             for y, dat in dl.items():
-                 self.times[x][y] = 0
-                 if not dat.get('nat',1):
--                    self.becache1.setdefault(downloadid,{})[y] = Bencached(bencode({'ip': dat['ip'], 
-+                    self.becache1.setdefault(x,{})[y] = Bencached(bencode({'ip': dat['ip'], 
-                         'port': dat['port'], 'peer id': y}))
--                    self.becache2.setdefault(downloadid,{})[y] = Bencached(bencode({'ip': dat['ip'], 
-+                    self.becache2.setdefault(x,{})[y] = Bencached(bencode({'ip': dat['ip'], 
-                         'port': dat['port']}))
-         self.reannounce_interval = config['reannounce_interval']
-         self.save_dfile_interval = config['save_dfile_interval']
-@@ -351,6 +351,9 @@
-                     peers[myid] = {'ip': ip, 'port': port, 'left': left, "local_override" : local_override}
-                 else:
-                     peers[myid] = {'ip': ip, 'port': port, 'left': left}
-+                if not self.natcheck or local_override:
-+                    self.becache1.setdefault(infohash,{})[myid] = Bencached(bencode({'ip': ip, 'port': port, 'peer id': myid}))
-+                    self.becache2.setdefault(infohash,{})[myid] = Bencached(bencode({'ip': ip, 'port': port}))
-             else:
-                 peers[myid]['left'] = left
-             if params.get('event', '') == 'completed':
-@@ -365,26 +368,25 @@
-                 peers[myid]['nat'] = 0
-         else:
-             if peers.has_key(myid) and peers[myid]['ip'] == ip:
--                if not peers[myid].get('nat',1):
-+                try:
-                     del self.becache1[infohash][myid]
-                     del self.becache2[infohash][myid]
-+                except KeyError:
-+                    pass
-                 del peers[myid]
-                 del ts[myid]
-         data = {'interval': self.reannounce_interval}
--        cache1 = self.cache1.setdefault(infohash, [])
--        cache2 = self.cache2.setdefault(infohash, [])
--        if params.get('no_peer_id',0):
--            cache = cache2
--        else:
--            cache = cache1
-         if rsize > 0:
-+            if params.get('no_peer_id', 0):
-+                cache = self.cache2.setdefault(infohash, [])
-+                b = self.becache2
-+            else:
-+                cache = self.cache1.setdefault(infohash, [])
-+                b = self.becache1
-             if len(cache) < rsize:
--                del cache1[:]
--                cache1.extend(self.becache1[infohash].values())
--                shuffle(cache1)
--                del cache2[:]
--                cache2.extend(self.becache2[infohash].values())
--                shuffle(cache2)
-+                del cache[:]
-+                cache.extend(b.setdefault(infohash, {}).values())
-+                shuffle(cache)
-             data['peers'] = cache[-rsize:]
-             del cache[-rsize:]
-         else:
-@@ -403,7 +405,7 @@
-             else:
-                 record['nat'] += 1
-         if result:
--            self.becache1.setdefault(downloadid,{})[peerid] = Bencached(bencode({'ip': ip, 'port': port, 'peer id': myid}))
-+            self.becache1.setdefault(downloadid,{})[peerid] = Bencached(bencode({'ip': ip, 'port': port, 'peer id': peerid}))
-             self.becache2.setdefault(downloadid,{})[peerid] = Bencached(bencode({'ip': ip, 'port': port}))
- 
-     def save_dfile(self):
-@@ -420,9 +422,11 @@
-         for x in self.times.keys():
-             for myid, t in self.times[x].items():
-                 if t < self.prevtime:
--                    if not self.downloads[x][myid].get('nat',1):
-+                    try:
-                         del self.becache1[x][myid]
-                         del self.becache2[x][myid]
-+                    except KeyError:
-+                        pass
-                     del self.times[x][myid]
-                     del self.downloads[x][myid]
-         self.prevtime = time()



Home | Main Index | Thread Index | Old Index