diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-02 12:10:02 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-02 12:10:02 +0000 |
commit | 73dbd82b7d8788e6844f11f83107919ce0ce172c (patch) | |
tree | aadcf7e3eb63346b9d027bc24ff0f527346044fc | |
parent | 52513e6c9faac1808316d64d0d54791ad9f457d5 (diff) | |
download | netsurf-73dbd82b7d8788e6844f11f83107919ce0ce172c.tar.gz netsurf-73dbd82b7d8788e6844f11f83107919ce0ce172c.tar.bz2 |
Optimise fetch item selection when fetching many items from same host.
svn path=/trunk/netsurf/; revision=12920
-rw-r--r-- | content/fetch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/content/fetch.c b/content/fetch.c index 23650c530..3508b78cf 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -415,6 +415,7 @@ void fetch_dispatch_jobs(void) */ bool fetch_choose_and_dispatch(void) { + bool same_host; struct fetch *queueitem; queueitem = queue_ring; do { @@ -428,6 +429,15 @@ bool fetch_choose_and_dispatch(void) /* We can dispatch this item in theory */ return fetch_dispatch_job(queueitem); } + /* skip over other items with the same host */ + same_host = true; + while (same_host == true && queueitem->r_next != queue_ring) { + if (lwc_string_isequal(queueitem->host, + queueitem->r_next->host, &same_host) == + lwc_error_ok && same_host == true) { + queueitem = queueitem->r_next; + } + } queueitem = queueitem->r_next; } while (queueitem != queue_ring); return false; |