Hi all,

Late this night, I had an issue I didn't met during my previous tests, related 
to the cache feature : sometimes, I had some corrupted images in the browser.
After adding some debug messages, it seems there's an issue in 
cache_store_http_forward_data() when there is not enough contiguous space 
available.
For example, with an image of 6532 bytes :
- first, the headers are captured = 287 bytes
- then, it tries to fill the cache but can only read 2609 bytes, skipping the 
first 287 bytes to ignore headers
- cache_store_http_forward_data() has to be called a second time, that's where 
I think the issue occurs : it will bypass 287 bytes of headers again, while it 
shouldn't => only the last 3636 bytes will be read instead of the remaining 
3923 ones :
[code]
                                /* Skip remaining headers to fill the cache */
                                b_adv(msg->chn->buf, st->hdrs_len);
                                ret = shctx_row_data_append(shctx,
                                                            st->first_block,
                                                            (unsigned char 
*)bi_ptr(msg->chn->buf),
                                                            
MIN(bi_contig_data(msg->chn->buf), len - st->hdrs_len));
                                /* Rewind the buffer to forward all data */
                                b_rew(msg->chn->buf, st->hdrs_len);
[/code]

I won't be able to make more tests before this evening, but I hope there is 
enough details ;-)

Also, I've not checked yet but I was wondering : is it specific to the cache 
filter or can we find the same issue in other ones (compression for example) ?

Cyril

Reply via email to