Update to development version 3.9.1

This commit is contained in:
Mario Sergio Fujikawa Ferreira 2005-02-27 18:14:14 +00:00
parent 1ceb4a8dcc
commit 6ac5448407
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=129912
10 changed files with 6 additions and 150 deletions

View file

@ -6,8 +6,7 @@
#
PORTNAME= BitTorrent
PORTVERSION= 3.9.0
PORTREVISION= 4
PORTVERSION= 3.9.1
PORTEPOCH= 1
CATEGORIES?= net python
MASTER_SITES= http://www.bittorrent.com/

View file

@ -1,2 +1,2 @@
MD5 (BitTorrent-3.9.0.tar.gz) = 749d676687accf62f963ee395cc510ff
SIZE (BitTorrent-3.9.0.tar.gz) = 136383
MD5 (BitTorrent-3.9.1.tar.gz) = 806ad575397ec55b12b65fdd66e4fb3b
SIZE (BitTorrent-3.9.1.tar.gz) = 145808

View file

@ -1,11 +0,0 @@
--- BitTorrent.orig/Downloader.py Mon Dec 20 20:39:14 2004
+++ BitTorrent/Downloader.py Wed Dec 29 01:13:08 2004
@@ -205,7 +205,7 @@
self.connection.send_interested()
self.example_interest = interest
self.downloader.picker.requested(interest, self.have.numfalse == 0)
- while len(self.active_requests) < self.backlog * 2:
+ while len(self.active_requests) < (self.backlog-2) * 5 + 2:
begin, length = self.downloader.storage.new_request(interest)
self.active_requests.append((interest, begin, length))
self.connection.send_request(interest, begin, length)

View file

@ -1,15 +0,0 @@
--- BitTorrent.orig/download.py Mon Dec 20 20:39:15 2004
+++ BitTorrent/download.py Wed Dec 29 01:13:08 2004
@@ -144,7 +144,11 @@
if filelist:
return None
return 1
- s = Storage(None, None, zip(myfiles, metainfo.sizes), check_only=True)
+ try:
+ s = Storage(None, None, zip(myfiles, metainfo.sizes),
+ check_only=True)
+ except:
+ return None
filename = os.path.join(config['data_dir'], 'resume',
infohash.encode('hex'))
try:

View file

@ -1,45 +0,0 @@
--- BitTorrent/zurllib.py.orig Wed Jan 5 20:41:27 2005
+++ BitTorrent/zurllib.py Wed Jan 5 20:41:50 2005
@@ -10,7 +10,7 @@
# Written by John Hoffman
-from httplib import HTTPConnection
+from httplib import HTTPConnection, HTTPException
from urlparse import urlparse
import socket
from gzip import GzipFile
@@ -20,6 +20,15 @@
MAX_REDIRECTS = 10
+class btHTTPcon(HTTPConnection): # attempt to add automatic connection timeout
+ def connect(self):
+ HTTPConnection.connect(self)
+ try:
+ self.sock.settimeout(30)
+ except:
+ pass
+
+
class urlopen:
def __init__(self, url):
self.tries = 0
@@ -39,11 +48,14 @@
if query:
url += '?'+query
# if fragment:
- self.connection = HTTPConnection(netloc)
- self.connection.request('GET', url, None,
+ try:
+ self.connection = btHTTPcon(netloc)
+ self.connection.request('GET', url, None,
{ 'User-Agent': 'BitTorrent/' + version,
'Accept-Encoding': 'gzip' } )
- self.response = self.connection.getresponse()
+ self.response = self.connection.getresponse()
+ except HTTPException, e:
+ raise IOError, ('http error', str(e))
status = self.response.status
if status in (301,302):
try:

View file

@ -6,8 +6,7 @@
#
PORTNAME= BitTorrent
PORTVERSION= 3.9.0
PORTREVISION= 4
PORTVERSION= 3.9.1
PORTEPOCH= 1
CATEGORIES?= net python
MASTER_SITES= http://www.bittorrent.com/

View file

@ -1,2 +1,2 @@
MD5 (BitTorrent-3.9.0.tar.gz) = 749d676687accf62f963ee395cc510ff
SIZE (BitTorrent-3.9.0.tar.gz) = 136383
MD5 (BitTorrent-3.9.1.tar.gz) = 806ad575397ec55b12b65fdd66e4fb3b
SIZE (BitTorrent-3.9.1.tar.gz) = 145808

View file

@ -1,11 +0,0 @@
--- BitTorrent.orig/Downloader.py Mon Dec 20 20:39:14 2004
+++ BitTorrent/Downloader.py Wed Dec 29 01:13:08 2004
@@ -205,7 +205,7 @@
self.connection.send_interested()
self.example_interest = interest
self.downloader.picker.requested(interest, self.have.numfalse == 0)
- while len(self.active_requests) < self.backlog * 2:
+ while len(self.active_requests) < (self.backlog-2) * 5 + 2:
begin, length = self.downloader.storage.new_request(interest)
self.active_requests.append((interest, begin, length))
self.connection.send_request(interest, begin, length)

View file

@ -1,15 +0,0 @@
--- BitTorrent.orig/download.py Mon Dec 20 20:39:15 2004
+++ BitTorrent/download.py Wed Dec 29 01:13:08 2004
@@ -144,7 +144,11 @@
if filelist:
return None
return 1
- s = Storage(None, None, zip(myfiles, metainfo.sizes), check_only=True)
+ try:
+ s = Storage(None, None, zip(myfiles, metainfo.sizes),
+ check_only=True)
+ except:
+ return None
filename = os.path.join(config['data_dir'], 'resume',
infohash.encode('hex'))
try:

View file

@ -1,45 +0,0 @@
--- BitTorrent/zurllib.py.orig Wed Jan 5 20:41:27 2005
+++ BitTorrent/zurllib.py Wed Jan 5 20:41:50 2005
@@ -10,7 +10,7 @@
# Written by John Hoffman
-from httplib import HTTPConnection
+from httplib import HTTPConnection, HTTPException
from urlparse import urlparse
import socket
from gzip import GzipFile
@@ -20,6 +20,15 @@
MAX_REDIRECTS = 10
+class btHTTPcon(HTTPConnection): # attempt to add automatic connection timeout
+ def connect(self):
+ HTTPConnection.connect(self)
+ try:
+ self.sock.settimeout(30)
+ except:
+ pass
+
+
class urlopen:
def __init__(self, url):
self.tries = 0
@@ -39,11 +48,14 @@
if query:
url += '?'+query
# if fragment:
- self.connection = HTTPConnection(netloc)
- self.connection.request('GET', url, None,
+ try:
+ self.connection = btHTTPcon(netloc)
+ self.connection.request('GET', url, None,
{ 'User-Agent': 'BitTorrent/' + version,
'Accept-Encoding': 'gzip' } )
- self.response = self.connection.getresponse()
+ self.response = self.connection.getresponse()
+ except HTTPException, e:
+ raise IOError, ('http error', str(e))
status = self.response.status
if status in (301,302):
try: