prevent odd curl non completion behaviour

svn path=/trunk/netsurf/; revision=13024
This commit is contained in:
Vincent Sanders 2011-10-09 17:22:57 +00:00
parent 6e23106b45
commit 5d06dbf974
2 changed files with 17 additions and 5 deletions

View File

@ -514,10 +514,12 @@ void fetch_poll(void)
if (!fetch_active)
return; /* No point polling, there's no fetch active. */
while (fetcher != NULL) {
/* LOG(("Polling fetcher for %s",
lwc_string_data(fetcher->scheme_name))); */
next_fetcher = fetcher->next_fetcher;
fetcher->poll_fetcher(fetcher->scheme_name);
if (fetcher->poll_fetcher != NULL) {
/* LOG(("Polling fetcher for %s",
lwc_string_data(fetcher->scheme_name))); */
fetcher->poll_fetcher(fetcher->scheme_name);
}
fetcher = next_fetcher;
}
}

View File

@ -60,6 +60,10 @@
*/
#include <desktop/browser.h>
/* uncomment this to use scheduler based calling
#define FETCHER_CURLL_SCHEDULED 1
*/
/** SSL certificate info */
struct cert_info {
X509 *cert; /**< Pointer to certificate */
@ -252,7 +256,11 @@ void fetch_curl_register(void)
fetch_curl_start,
fetch_curl_abort,
fetch_curl_free,
#ifdef FETCHER_CURLL_SCHEDULED
NULL,
#else
fetch_curl_poll,
#endif
fetch_curl_finalise)) {
LOG(("Unable to register cURL fetcher for %s",
data->protocols[i]));
@ -758,10 +766,12 @@ void fetch_curl_poll(lwc_string *scheme_ignored)
}
curl_msg = curl_multi_info_read(fetch_curl_multi, &queue);
}
#ifdef FETCHER_CURLL_SCHEDULED
if (running != 0) {
schedule(10, (schedule_callback_fn)fetch_curl_poll, fetch_curl_poll);
schedule(1, (schedule_callback_fn)fetch_curl_poll, fetch_curl_poll);
}
#endif
}