--- a/mercurial/url.py Wed Feb 16 04:28:17 2011 +0100
+++ b/mercurial/url.py Wed Feb 16 04:28:17 2011 +0100
@@ -291,16 +291,16 @@
def __len__(self):
return self._len
-def _gen_sendfile(connection):
+def _gen_sendfile(orgsend):
def _sendfile(self, data):
# send a file
if isinstance(data, httpsendfile):
# if auth required, some data sent twice, so rewind here
data.seek(0)
for chunk in util.filechunkiter(data):
- connection.send(self, chunk)
+ orgsend(self, chunk)
else:
- connection.send(self, data)
+ orgsend(self, data)
return _sendfile
has_https = hasattr(urllib2, 'HTTPSHandler')
@@ -353,7 +353,7 @@
class httpconnection(keepalive.HTTPConnection):
# must be able to send big bundle as stream.
- send = _gen_sendfile(keepalive.HTTPConnection)
+ send = _gen_sendfile(keepalive.HTTPConnection.send)
def connect(self):
if has_https and self.realhostport: # use CONNECT proxy
@@ -595,7 +595,7 @@
class httpsconnection(BetterHTTPS):
response_class = keepalive.HTTPResponse
# must be able to send big bundle as stream.
- send = _gen_sendfile(BetterHTTPS)
+ send = _gen_sendfile(BetterHTTPS.send)
getresponse = keepalive.wrapgetresponse(httplib.HTTPSConnection)
def connect(self):