mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
Avoid making a new nsurl to remove fragment if there is no fragment.
svn path=/trunk/netsurf/; revision=12958
This commit is contained in:
parent
7d3a84231e
commit
17525fbf25
@ -727,9 +727,14 @@ nserror llcache_object_retrieve(nsurl *url, uint32_t flags,
|
|||||||
/* Look for a query segment */
|
/* Look for a query segment */
|
||||||
has_query = nsurl_enquire(url, NSURL_QUERY);
|
has_query = nsurl_enquire(url, NSURL_QUERY);
|
||||||
|
|
||||||
error = nsurl_defragment(url, &defragmented_url);
|
/* Get rid of any url fragment */
|
||||||
if (error != NSERROR_OK)
|
if (nsurl_enquire(url, NSURL_FRAGMENT)) {
|
||||||
return error;
|
error = nsurl_defragment(url, &defragmented_url);
|
||||||
|
if (error != NSERROR_OK)
|
||||||
|
return error;
|
||||||
|
} else {
|
||||||
|
defragmented_url = nsurl_ref(url);
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & LLCACHE_RETRIEVE_FORCE_FETCH || post != NULL) {
|
if (flags & LLCACHE_RETRIEVE_FORCE_FETCH || post != NULL) {
|
||||||
/* Create new object */
|
/* Create new object */
|
||||||
@ -751,8 +756,8 @@ nserror llcache_object_retrieve(nsurl *url, uint32_t flags,
|
|||||||
/* Add new object to uncached list */
|
/* Add new object to uncached list */
|
||||||
llcache_object_add_to_list(obj, &llcache->uncached_objects);
|
llcache_object_add_to_list(obj, &llcache->uncached_objects);
|
||||||
} else {
|
} else {
|
||||||
error = llcache_object_retrieve_from_cache(defragmented_url, flags, referer,
|
error = llcache_object_retrieve_from_cache(defragmented_url,
|
||||||
post, redirect_count, &obj);
|
flags, referer, post, redirect_count, &obj);
|
||||||
if (error != NSERROR_OK) {
|
if (error != NSERROR_OK) {
|
||||||
nsurl_unref(defragmented_url);
|
nsurl_unref(defragmented_url);
|
||||||
return error;
|
return error;
|
||||||
|
Loading…
Reference in New Issue
Block a user