aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-09-15 19:10:58 +0200
committerbptato <nincsnevem662@gmail.com>2024-09-15 19:13:08 +0200
commit4a394302f3197dfa48edb09bd0773aa94dc8188d (patch)
treee67aff6c2dfcf628a9ae9558ee6a6280ab31c0a7 /src/utils
parent7656357382d603243c6b3e5f80557a23e4666313 (diff)
downloadchawan-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 'src/utils')
0 files changed, 0 insertions, 0 deletions