[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gzio/http problem (was: [PATCH] Rewrite and fix grub_bufio_read())
From: |
Stefan Fritsch |
Subject: |
gzio/http problem (was: [PATCH] Rewrite and fix grub_bufio_read()) |
Date: |
Thu, 28 Apr 2016 23:30:11 +0200 |
User-agent: |
KMail/4.14.10 (Linux/4.5.0-1-amd64; KDE/4.14.14; x86_64; ; ) |
On Thursday 28 April 2016 21:52:27, Stefan Fritsch wrote:
> You are right, I was misreading the second part of the code with
> the direct read. Now I wonder why the patch helped with our
> problem. I will do some more debugging.
The real problem seems to be that http sometimes (depending on network
timing?) returns short reads but gzio does not check how many bytes
have actually been read. The looping in my patch for grub_bufio_read()
fixed this by never returning a short read.
I guess two things should be fixed: gzio should check the return value
of grub_file_read(), and (assuming that other code depends on there
not being short reads, too) http should be fixed. Or maybe
grub_file_read() should get a loop that ensures that there are no
short reads?