mirror of
https://github.com/eblot/pybootd.git
synced 2024-09-11 22:17:44 +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())
|
url = joinpath(path, bootp_buf[BOOTP_FILE].decode())
|
||||||
try:
|
try:
|
||||||
resource = urlopen(url)
|
resource = urlopen(url)
|
||||||
int(resource.info()['Content-Length'])
|
bootfile_size = int(resource.info()['Content-Length'])
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self.log.error('Cannot retrieve size of %s: %s',
|
self.log.error('Cannot retrieve size of %s: %s',
|
||||||
url, exc)
|
url, exc)
|
||||||
if bootfile_size:
|
if bootfile_size:
|
||||||
|
self.log.debug('Bootfile %s is %d byte long',
|
||||||
|
bootfile_name, bootfile_size)
|
||||||
bootfile_block = (bootfile_size+511)//512
|
bootfile_block = (bootfile_size+511)//512
|
||||||
buf += spack('!BBH', 13, scalc('!H'), bootfile_block)
|
buf += spack('!BBH', 13, scalc('!H'), bootfile_block)
|
||||||
if 60 in client_params:
|
if 60 in client_params:
|
||||||
|
Loading…
Reference in New Issue
Block a user