loader: tftp: Copy the first block into the cache
tftp_open reads the first block so copy it in the cached data. If we have more than one block (i.e. we called tftp_read before tftp_preload) simply just reset the transfer. Reported by: mmel Reviewed by: mmel, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33697
This commit is contained in:
parent
b6f7942cbc
commit
dfc9c1d493
@ -680,6 +680,13 @@ tftp_preload(struct open_file *f)
|
|||||||
start = getsecs();
|
start = getsecs();
|
||||||
printf("Preloading %s ", tftpfile->path);
|
printf("Preloading %s ", tftpfile->path);
|
||||||
#endif
|
#endif
|
||||||
|
if (tftpfile->currblock == 1)
|
||||||
|
bcopy(tftpfile->tftp_hdr->th_data,
|
||||||
|
cache,
|
||||||
|
tftpfile->validsize);
|
||||||
|
else
|
||||||
|
tftpfile->currblock = 0;
|
||||||
|
|
||||||
while (tftpfile->islastblock == 0) {
|
while (tftpfile->islastblock == 0) {
|
||||||
twiddle(32);
|
twiddle(32);
|
||||||
rc = tftp_getnextblock(tftpfile);
|
rc = tftp_getnextblock(tftpfile);
|
||||||
|
Loading…
Reference in New Issue
Block a user