comparison mercurial/httpconnection.py @ 14430:c864f5e743ef

httprepo: handle large lengths by bypassing the len() operator
author Matt Mackall <mpm@selenic.com>
date Tue, 24 May 2011 17:30:00 -0500
parents 436e5379d7ba
children 4a43e23b8c55
comparison
equal deleted inserted replaced
14429:c4c5e3802e9c 14430:c864f5e743ef
35 self.seek = self._data.seek 35 self.seek = self._data.seek
36 self.close = self._data.close 36 self.close = self._data.close
37 self.write = self._data.write 37 self.write = self._data.write
38 self._len = os.fstat(self._data.fileno()).st_size 38 self._len = os.fstat(self._data.fileno()).st_size
39 self._pos = 0 39 self._pos = 0
40 self._total = len(self) / 1024 * 2 40 self._total = self._len / 1024 * 2
41 41
42 def read(self, *args, **kwargs): 42 def read(self, *args, **kwargs):
43 try: 43 try:
44 ret = self._data.read(*args, **kwargs) 44 ret = self._data.read(*args, **kwargs)
45 except EOFError: 45 except EOFError: