##// END OF EJS Templates
lfs: avoid quadratic performance in processing server responses...
Matt Harbison -
r44545:ffac09da default
parent child Browse files
Show More
@@ -503,7 +503,6 b' class _gitlfsremote(object):'
503 for k, v in headers:
503 for k, v in headers:
504 request.add_header(pycompat.strurl(k), pycompat.strurl(v))
504 request.add_header(pycompat.strurl(k), pycompat.strurl(v))
505
505
506 response = b''
507 try:
506 try:
508 with contextlib.closing(self.urlopener.open(request)) as res:
507 with contextlib.closing(self.urlopener.open(request)) as res:
509 contentlength = res.info().get(b"content-length")
508 contentlength = res.info().get(b"content-length")
@@ -520,11 +519,14 b' class _gitlfsremote(object):'
520 # blobstore
519 # blobstore
521 localstore.download(oid, res, contentlength)
520 localstore.download(oid, res, contentlength)
522 else:
521 else:
522 blocks = []
523 while True:
523 while True:
524 data = res.read(1048576)
524 data = res.read(1048576)
525 if not data:
525 if not data:
526 break
526 break
527 response += data
527 blocks.append(data)
528
529 response = b"".join(blocks)
528 if response:
530 if response:
529 ui.debug(b'lfs %s response: %s' % (action, response))
531 ui.debug(b'lfs %s response: %s' % (action, response))
530 except util.urlerr.httperror as ex:
532 except util.urlerr.httperror as ex:
General Comments 0
You need to be logged in to leave comments. Login now