mirror of
https://github.com/eblot/pybootd.git
synced 2024-10-27 00:51:54 +03:00
Add a trace and fix remote file size
This commit is contained in:
parent
d284d5bfce
commit
40abb45ddd
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user