mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
save complete: Change de-duplication to compare URLs, rather than contents.
We seem to have more than one content for the same resource. For example: * save `<img src="about:logo"><img src="about:logo">` as img-test.html * run `rm -rf test-save && make && ./nsgtk img-test.html` * ctrl+s * save as "test-save" in the current netsurf dir. * run `md5sum test-save/*` before and after this commit. The de-duplication works with URLs, where it wasn't working with hlcache_handles or contents.
This commit is contained in:
parent
044ddd5d43
commit
5aeca580f4
@ -370,8 +370,10 @@ save_complete_save_stylesheet(save_complete_ctx *ctx, hlcache_handle *css)
|
||||
char filename[32];
|
||||
bool result;
|
||||
|
||||
if (save_complete_ctx_has_content(ctx, css))
|
||||
if (save_complete_ctx_find_content(ctx,
|
||||
hlcache_handle_get_url(css)) != NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (save_complete_ctx_add_content(ctx, css) == false) {
|
||||
guit->misc->warning("NoMemory", 0);
|
||||
@ -473,8 +475,10 @@ save_complete_save_html_object(save_complete_ctx *ctx, hlcache_handle *obj)
|
||||
if (obj_data == NULL)
|
||||
return true;
|
||||
|
||||
if (save_complete_ctx_has_content(ctx, obj))
|
||||
if (save_complete_ctx_find_content(ctx,
|
||||
hlcache_handle_get_url(obj)) != NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (save_complete_ctx_add_content(ctx, obj) == false) {
|
||||
guit->misc->warning("NoMemory", 0);
|
||||
|
Loading…
Reference in New Issue
Block a user