[squid-dev] [PATCH] Bug 3875 MimeIcon error handling
Amos Jeffries
squid3 at treenet.co.nz
Mon Jun 1 23:33:03 UTC 2015
On 21/05/2015 3:22 a.m., Amos Jeffries wrote:
> This is an attempt to improve the MimeIcon reliability when filesystem
> I/O errors or others cause the icon data to not be loadable.
>
> The loading process is re-worked to guarantee that once the
> MimeIon::created callback occurs it will result in a valid StoreEntry in
> the cache representing the wanted icon.
> * If the image can be loaded without any issues it will be placed in
> the cache as a 200 response.
> * If errors prevent the image being loaded or necessary parameters
> (size and mtime) being known a 204 object will be placed into the cache.
>
> I have selected 204 as the representation of errors since the bug is not
> in the clients request (eliminating 400, 404, etc), a 500 would be
> revealing details about server internals unnecessarily often and incur
> extra complexity creating the error page. 204 also avoids needing to set
> and emit Content-Length header, and just enough different from 200 to
> use as a special-case test.
>
>
>
> NP: It started with just correcting the errno usage, but other bugs
> promptly started appearing once I got to seriously testing this load
> process. So far it fixes:
> * several assertions resulting from StoreEntry being left invalid in
> cache limbo beween created hash entries and valid mem_obj data.
> * on startup 6+ repeated attempts to load absent icons files which dont
> exist in the filesystem.
> * buffer overfow on misconfigured or corrupt mime.conf file entries
> * incorrect debugs messages about file I/O errors
> * large error pages delivered when icons not installed (when it doesnt
> assert from the StoreEntry)
>
> Amos
>
If there are no objections I will appy this tomorrow.
Amos
More information about the squid-dev
mailing list