diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2011-03-12 19:25:40 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2011-03-12 19:25:40 +0000 |
commit | d558aae0bbc228caf6837309f2d9bfe18bb5a82e (patch) | |
tree | 60bf5261a535b1b29fd2535779f4be8f2488eae9 | |
parent | 1ba5d85c1a0834469f64d9d68569acf2411ac908 (diff) | |
download | netsurf-d558aae0bbc228caf6837309f2d9bfe18bb5a82e.tar.gz netsurf-d558aae0bbc228caf6837309f2d9bfe18bb5a82e.tar.bz2 |
I hate this, but it helps to prevent stalling during early fetch stages with curl
svn path=/trunk/netsurf/; revision=11986
-rw-r--r-- | content/fetchers/curl.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c index 86983ea28..56119bef1 100644 --- a/content/fetchers/curl.c +++ b/content/fetchers/curl.c @@ -51,6 +51,12 @@ #include "utils/ring.h" #include "utils/useragent.h" +/* BIG FAT WARNING: This is here because curl doesn't give you an FD to + * poll on, until it has processed a bit of the handle. So we need schedules + * in order to make this work. + */ +#include <desktop/browser.h> + /** SSL certificate info */ struct cert_info { X509 *cert; /**< Pointer to certificate */ @@ -440,7 +446,9 @@ bool fetch_curl_initiate_fetch(struct curl_fetch_info *fetch, CURL *handle) /* add to the global curl multi handle */ codem = curl_multi_add_handle(fetch_curl_multi, fetch->curl_handle); assert(codem == CURLM_OK || codem == CURLM_CALL_MULTI_PERFORM); - + + schedule(1, (schedule_callback_fn)fetch_curl_poll, NULL); + return true; } @@ -702,7 +710,9 @@ void fetch_curl_poll(const char *scheme_ignored) int running, queue; CURLMcode codem; CURLMsg *curl_msg; - + + schedule_remove((schedule_callback_fn)fetch_curl_poll, NULL); + /* do any possible work on the current fetches */ do { codem = curl_multi_perform(fetch_curl_multi, &running); |