diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-02-03 09:18:49 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-02-03 09:18:49 -0300 |
commit | ba53afebc95493fcf3a7105989e2cabb015b4b1b (patch) | |
tree | ba2d4120e27956da3c5dc2e276731d5c50db5b75 /src/cache.c | |
parent | 69bcd6963fabfd547495c186e3ea570d2f33cbed (diff) |
Fix a race condition with charset, and the case of charset after CSS in HEAD
Race condition example: www.blisty.cz
charset after CSS ex. : http://www.daemonnews.org
Diffstat (limited to 'src/cache.c')
-rw-r--r-- | src/cache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cache.c b/src/cache.c index 8d01c40e..8ab9e1a4 100644 --- a/src/cache.c +++ b/src/cache.c @@ -424,7 +424,8 @@ static void Cache_ref_data(CacheEntry_t *entry) if (entry) { entry->DataRefcount++; _MSG("DataRefcount++: %d\n", entry->DataRefcount); - if (entry->CharsetDecoder && entry->DataRefcount == 1) { + if (entry->CharsetDecoder && + (!entry->UTF8Data || entry->DataRefcount == 1)) { dStr_free(entry->UTF8Data, 1); entry->UTF8Data = a_Decode_process(entry->CharsetDecoder, entry->Data->str, @@ -518,7 +519,7 @@ const char *a_Cache_set_content_type(const DilloUrl *url, const char *ctype, entry->CharsetDecoder = a_Decode_charset_init(charset); dFree(charset); curr = Cache_current_content_type(entry); - + /* Invalidate UTF8Data */ dStr_free(entry->UTF8Data, 1); entry->UTF8Data = NULL; |