diff options
author | bptato <nincsnevem662@gmail.com> | 2024-09-15 19:10:58 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-09-15 19:13:08 +0200 |
commit | 4a394302f3197dfa48edb09bd0773aa94dc8188d (patch) | |
tree | e67aff6c2dfcf628a9ae9558ee6a6280ab31c0a7 /test/js | |
parent | 7656357382d603243c6b3e5f80557a23e4666313 (diff) | |
download | chawan-4a394302f3197dfa48edb09bd0773aa94dc8188d.tar.gz |
loader: fix rbtCache race
I thought this would work fine, but then images weren't loading. Upon closer inspection I realized we don't necessarily let the image decoder finish reading the entire file on pass 1 (header parsing), which means pass 2 (decoding) can end up reading a partially downloaded cache file. To fix this, we now fall back to streaming mode when an open handle to the cached item still exists. (An alternative would be to wait for the cached item to finish loading, but that's harder to implement and might be slower anyway - the current implementation allows for the decoder to run while an image is still being loaded, but we couldn't do that with the second approach.)
Diffstat (limited to 'test/js')
0 files changed, 0 insertions, 0 deletions