From 7ef9b7600c258d5cd5a4cfc1d2b9090764c34751 Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 3 Aug 2023 12:09:24 +1000 Subject: [PATCH] Use DEFAULT_BUFFER_SIZE for md5sum --- gns3server/utils/images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/utils/images.py b/gns3server/utils/images.py index 6fb79f35..72498a82 100644 --- a/gns3server/utils/images.py +++ b/gns3server/utils/images.py @@ -20,7 +20,7 @@ import hashlib from ..config import Config from . import force_unix_path - +from io import DEFAULT_BUFFER_SIZE import logging log = logging.getLogger(__name__) @@ -173,7 +173,7 @@ def md5sum(path, stopped_event=None): if stopped_event is not None and stopped_event.is_set(): log.error("MD5 sum calculation of `{}` has stopped due to cancellation".format(path)) return - buf = f.read(128) + buf = f.read(DEFAULT_BUFFER_SIZE) if not buf: break m.update(buf)