pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/bittornado apply the patch from



details:   https://anonhg.NetBSD.org/pkgsrc/rev/170d345f3eaf
branches:  trunk
changeset: 485341:170d345f3eaf
user:      mrg <mrg%pkgsrc.org@localhost>
date:      Tue Dec 07 04:23:59 2004 +0000

description:
apply the patch from
http://arctic.org/~dean/patches/bittornado-0.3.7-source-port-and-iptos.patch
that fixes the setting the TOS to IPTOS_THROUGHPUT and allows one to control
the source-port all connections come from, not just the listen port.  (the
actual port is still randomized in the 10000-60000 port range by default.)

bump PKGREVISION.

approved by wiz@.

diffstat:

 net/bittornado/Makefile.common  |   3 +-
 net/bittornado/distinfo         |   3 +-
 net/bittornado/patches/patch-ab |  46 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 2 deletions(-)

diffs (74 lines):

diff -r bbb7805fa205 -r 170d345f3eaf net/bittornado/Makefile.common
--- a/net/bittornado/Makefile.common    Tue Dec 07 03:59:49 2004 +0000
+++ b/net/bittornado/Makefile.common    Tue Dec 07 04:23:59 2004 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile.common,v 1.2 2004/11/30 12:31:29 wiz Exp $
+# $NetBSD: Makefile.common,v 1.3 2004/12/07 04:23:59 mrg Exp $
 #
 
 DISTNAME=              BitTornado-0.3.8
+PKGREVISION=           1
 CATEGORIES=            net
 MASTER_SITES=          http://www.bittornado.com/download/
 
diff -r bbb7805fa205 -r 170d345f3eaf net/bittornado/distinfo
--- a/net/bittornado/distinfo   Tue Dec 07 03:59:49 2004 +0000
+++ b/net/bittornado/distinfo   Tue Dec 07 04:23:59 2004 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.2 2004/11/30 12:31:29 wiz Exp $
+$NetBSD: distinfo,v 1.3 2004/12/07 04:23:59 mrg Exp $
 
 SHA1 (BitTornado-0.3.8.tar.gz) = efb5d51b391e8758bdebf959a485e186ad5579f8
 Size (BitTornado-0.3.8.tar.gz) = 220481 bytes
 SHA1 (patch-aa) = a88096122a34776b72dfc18f1d95a1736c71b54b
+SHA1 (patch-ab) = 0dd8a5b442047fa0c4040b808b494301dbbc942b
diff -r bbb7805fa205 -r 170d345f3eaf net/bittornado/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/bittornado/patches/patch-ab   Tue Dec 07 04:23:59 2004 +0000
@@ -0,0 +1,46 @@
+$NetBSD: patch-ab,v 1.1 2004/12/07 04:23:59 mrg Exp $
+
+--- BitTornado/SocketHandler.py.orig   2004-07-11 05:28:58.000000000 +1000
++++ BitTornado/SocketHandler.py        2004-12-06 14:22:13.000000000 +1100
+@@ -142,7 +142,7 @@
+             if k.socket is not None:
+                 self._close_socket(k)
+ 
+-    def bind(self, port, bind = '', reuse = False, ipv6_socket_style = 1, upnp = 0):
++    def bind(self, port, bind = '', reuse = True, ipv6_socket_style = 1, upnp = 0):
+         port = int(port)
+         addrinfos = []
+         self.servers = {}
+@@ -173,6 +173,10 @@
+                 if reuse:
+                     server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+                 server.setblocking(0)
++              try:
++                  server.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 8)
++              except:
++                  pass
+                 server.bind(addrinfo[4])
+                 self.servers[server.fileno()] = server
+                 if bind:
+@@ -203,7 +207,7 @@
+             self.port_forwarded = port
+         self.port = port
+ 
+-    def find_and_bind(self, minport, maxport, bind = '', reuse = False,
++    def find_and_bind(self, minport, maxport, bind = '', reuse = True,
+                       ipv6_socket_style = 1, upnp = 0, randomizer = False):
+         e = 'maxport less than minport - no ports to check'
+         if maxport-minport < 50 or not randomizer:
+@@ -236,6 +240,12 @@
+             handler = self.handler
+         sock = socket.socket(socktype, socket.SOCK_STREAM)
+         sock.setblocking(0)
++        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
++      try:
++          server.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 8)
++      except:
++          pass
++        sock.bind(('', self.port))
+         try:
+             sock.connect_ex(dns)
+         except socket.error:



Home | Main Index | Thread Index | Old Index