From 40abb45ddd22e2725470239d05ca80eef0bc6c8a Mon Sep 17 00:00:00 2001 From: Emmanuel Blot Date: Sun, 12 Apr 2020 18:38:17 +0200 Subject: [PATCH] Add a trace and fix remote file size --- pybootd/pxed.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pybootd/pxed.py b/pybootd/pxed.py index a8bd1ac..c1e80b6 100644 --- a/pybootd/pxed.py +++ b/pybootd/pxed.py @@ -419,11 +419,13 @@ class BootpServer: url = joinpath(path, bootp_buf[BOOTP_FILE].decode()) try: resource = urlopen(url) - int(resource.info()['Content-Length']) + bootfile_size = int(resource.info()['Content-Length']) except Exception as exc: self.log.error('Cannot retrieve size of %s: %s', url, exc) if bootfile_size: + self.log.debug('Bootfile %s is %d byte long', + bootfile_name, bootfile_size) bootfile_block = (bootfile_size+511)//512 buf += spack('!BBH', 13, scalc('!H'), bootfile_block) if 60 in client_params: