diff --git a/src/cache/cache.c b/src/cache/cache.c index 001c36563..fbeb0d743 100644 --- a/src/cache/cache.c +++ b/src/cache/cache.c @@ -153,7 +153,7 @@ get_cache_entry(struct uri *uri) cached->valid = 1; init_list(cached->frag); - cached->id = id_counter++; + cached->cache_id = id_counter++; object_nolock(cached, "cache_entry"); /* Debugging purpose. */ cached->box_item = add_listbox_leaf(&cache_browser, NULL, cached); @@ -388,7 +388,7 @@ add_fragment(struct cache_entry *cached, off_t offset, /* id marks each entry, and change each time it's modified, * used in HTML renderer. */ - cached->id = id_counter++; + cached->cache_id = id_counter++; /* Possibly insert the new data in the middle of existing fragment. */ foreach (f, cached->frag) { @@ -642,7 +642,7 @@ delete_entry_content(struct cache_entry *cached) del_from_list(f); frag_free(f); } - cached->id = id_counter++; + cached->cache_id = id_counter++; cached->length = 0; cached->incomplete = 1; diff --git a/src/cache/cache.h b/src/cache/cache.h index e19717bff..de0642775 100644 --- a/src/cache/cache.h +++ b/src/cache/cache.h @@ -42,7 +42,7 @@ struct cache_entry { unsigned char *ssl_info; /* SSL ciphers used during transfer */ unsigned char *encoding_info; /* Encoding used during transfer */ - unsigned int id; /* Change each time entry is modified. */ + unsigned int cache_id; /* Change each time entry is modified. */ time_t seconds; /* Access time. Used by 'If-Modified-Since' */ diff --git a/src/cache/dialogs.c b/src/cache/dialogs.c index 29a94461c..8e5ff73a2 100644 --- a/src/cache/dialogs.c +++ b/src/cache/dialogs.c @@ -128,7 +128,7 @@ get_cache_entry_info(struct listbox_item *item, struct terminal *term) #endif #ifdef CONFIG_DEBUG add_format_to_string(&msg, "\n%s: %d", "Refcount", get_object_refcount(cached)); - add_format_to_string(&msg, "\n%s: %u", _("ID", term), cached->id); + add_format_to_string(&msg, "\n%s: %u", _("ID", term), cached->cache_id); if (cached->head && *cached->head) { add_format_to_string(&msg, "\n%s:\n\n%s", _("Header", term), diff --git a/src/document/document.c b/src/document/document.c index a6d55e194..af8c09caa 100644 --- a/src/document/document.c +++ b/src/document/document.c @@ -33,7 +33,6 @@ #include "util/string.h" #include "viewer/text/link.h" - static INIT_LIST_OF(struct document, format_cache); struct document * @@ -46,7 +45,7 @@ init_document(struct cache_entry *cached, struct document_options *options) document->uri = get_uri_reference(cached->uri); object_lock(cached); - document->id = cached->id; + document->cache_id = cached->cache_id; document->cached = cached; init_list(document->forms); @@ -210,7 +209,7 @@ get_document_css_magic(struct document *document) foreach_uri (uri, index, &document->css_imports) { struct cache_entry *cached = find_in_cache(uri); - if (cached) css_magic += cached->id + cached->data_size; + if (cached) css_magic += cached->cache_id + cached->data_size; } return css_magic; @@ -252,7 +251,7 @@ get_cached_document(struct cache_entry *cached, struct document_options *options continue; if (options->no_cache - || cached->id != document->id + || cached->cache_id != document->cache_id || !check_document_css_magic(document)) { if (!is_object_used(document)) { done_document(document); @@ -285,7 +284,7 @@ shrink_format_cache(int whole) /* Destroy obsolete renderer documents which are already * out-of-sync. */ - if (document->cached->id == document->id) + if (document->cached->cache_id == document->cache_id) continue; done_document(document); diff --git a/src/document/document.h b/src/document/document.h index 6b762257d..441a8a942 100644 --- a/src/document/document.h +++ b/src/document/document.h @@ -202,7 +202,7 @@ struct document { unsigned char buf[7]; unsigned char buf_length; #endif - unsigned int id; /**< Used to check cache entries. */ + unsigned int cache_id; /**< Used to check cache entries. */ int cp; int width, height; /**< size of document */ diff --git a/src/document/renderer.c b/src/document/renderer.c index e5534ed20..3b38f4262 100644 --- a/src/document/renderer.c +++ b/src/document/renderer.c @@ -388,11 +388,12 @@ render_document(struct view_state *vs, struct document_view *doc_view, * XXX: What happens if a document is still loading in the * other tab when we press ^L here? */ if (vs->ecmascript_fragile - || (vs->ecmascript && vs->ecmascript->onload_snippets_owner - && document->id != vs->ecmascript->onload_snippets_owner)) + || (vs->ecmascript + && vs->ecmascript->onload_snippets_cache_id + && document->cache_id != vs->ecmascript->onload_snippets_cache_id)) ecmascript_reset_state(vs); assert(vs->ecmascript); - vs->ecmascript->onload_snippets_owner = document->id; + vs->ecmascript->onload_snippets_cache_id = document->cache_id; /* Passing of the onload_snippets pointers gives *_snippets() * some feeling of universality, shall we ever get any other diff --git a/src/ecmascript/ecmascript.h b/src/ecmascript/ecmascript.h index d24937b0d..e8d84b57e 100644 --- a/src/ecmascript/ecmascript.h +++ b/src/ecmascript/ecmascript.h @@ -52,7 +52,7 @@ struct ecmascript_interpreter { * ecmascript_fragile, but it can happen i.e. when the urrent document * is reloaded in another tab and then you just cause the current tab * to redraw. */ - unsigned int onload_snippets_owner; + unsigned int onload_snippets_cache_id; }; /* Why is the interpreter bound to {struct view_state} instead of {struct diff --git a/src/viewer/text/draw.c b/src/viewer/text/draw.c index fc7cfe2b8..db1395747 100644 --- a/src/viewer/text/draw.c +++ b/src/viewer/text/draw.c @@ -67,7 +67,7 @@ check_document_fragment(struct session *ses, struct document_view *doc_view) struct cache_entry *cached = document->cached; assert(cached); - if (cached->incomplete || cached->id != document->id) { + if (cached->incomplete || cached->cache_id != document->cache_id) { done_string(&fragment); return -2; }