diff options
author | James Bursa <james@netsurf-browser.org> | 2005-04-09 10:00:00 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-04-09 10:00:00 +0000 |
commit | c4d3ac1d8ff41dd89b827c94471dedf590cf29b7 (patch) | |
tree | a074a1ac8a2fa844c5ac3a5c28ca618d6404aaff /content/fetch.c | |
parent | 20c4d5d114cd25129c16ce1222384dcd0a6d7c0e (diff) | |
download | netsurf-c4d3ac1d8ff41dd89b827c94471dedf590cf29b7.tar.gz netsurf-c4d3ac1d8ff41dd89b827c94471dedf590cf29b7.tar.bz2 |
[project @ 2005-04-09 10:00:00 by bursa]
Serialize fetches with no host (should fix multiple local files not loading in certain cases).
svn path=/import/netsurf/; revision=1611
Diffstat (limited to 'content/fetch.c')
-rw-r--r-- | content/fetch.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/content/fetch.c b/content/fetch.c index cbd64a0e8..2b9ced728 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -241,6 +241,10 @@ struct fetch * fetch_start(char *url, char *referer, /* we only fail memory exhaustion */ if (res == URL_FUNC_NOMEM) goto failed; + if (!host) + host = strdup(""); + if (!host) + goto failed; res = url_scheme(url, &ref1); /* we only fail memory exhaustion */ @@ -323,25 +327,22 @@ struct fetch * fetch_start(char *url, char *referer, } /* look for a fetch from the same host */ - if (host) { - for (host_fetch = fetch_list; - host_fetch && (host_fetch->host == 0 || - strcasecmp(host_fetch->host, host) != 0); - host_fetch = host_fetch->next) + for (host_fetch = fetch_list; + host_fetch && strcasecmp(host_fetch->host, host) != 0; + host_fetch = host_fetch->next) + ; + if (host_fetch) { + /* fetch from this host in progress: + queue the new fetch */ + LOG(("queueing")); + fetch->curl_handle = 0; + /* queue at end */ + for (; host_fetch->queue_next; + host_fetch = host_fetch->queue_next) ; - if (host_fetch) { - /* fetch from this host in progress: - queue the new fetch */ - LOG(("queueing")); - fetch->curl_handle = 0; - /* queue at end */ - for (; host_fetch->queue_next; - host_fetch = host_fetch->queue_next) - ; - fetch->queue_prev = host_fetch; - host_fetch->queue_next = fetch; - return fetch; - } + fetch->queue_prev = host_fetch; + host_fetch->queue_next = fetch; + return fetch; } /* create the curl easy handle */ |