diff options
Diffstat (limited to 'beos')
-rw-r--r-- | beos/fetch_rsrc.cpp | 21 | ||||
-rw-r--r-- | beos/gui.cpp | 34 |
2 files changed, 23 insertions, 32 deletions
diff --git a/beos/fetch_rsrc.cpp b/beos/fetch_rsrc.cpp index 887be7960..9461f5c79 100644 --- a/beos/fetch_rsrc.cpp +++ b/beos/fetch_rsrc.cpp @@ -33,6 +33,7 @@ extern "C" { #include "utils/config.h" #include "content/fetch.h" +#include "content/fetchers.h" #include "content/urldb.h" #include "desktop/netsurf.h" #include "utils/nsoption.h" @@ -358,6 +359,16 @@ void fetch_rsrc_register(void) { lwc_string *scheme; int err; + const struct fetcher_operation_table fetcher_ops_rsrc = { + fetch_rsrc_initialise, + fetch_rsrc_can_fetch, + fetch_rsrc_setup, + fetch_rsrc_start, + fetch_rsrc_abort, + fetch_rsrc_free, + fetch_rsrc_poll, + fetch_rsrc_finalise + }; err = find_app_resources(); @@ -371,15 +382,7 @@ void fetch_rsrc_register(void) "(couldn't intern \"rsrc\")."); } - fetch_add_fetcher(scheme, - fetch_rsrc_initialise, - fetch_rsrc_can_fetch, - fetch_rsrc_setup, - fetch_rsrc_start, - fetch_rsrc_abort, - fetch_rsrc_free, - fetch_rsrc_poll, - fetch_rsrc_finalise); + fetcher_add(scheme, &fetcher_ops_rsrc); } void fetch_rsrc_unregister(void) diff --git a/beos/gui.cpp b/beos/gui.cpp index 4f06b9f04..f9e02d0de 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -47,7 +47,7 @@ extern "C" { #include "content/content.h" #include "content/content_protected.h" #include "content/fetch.h" -#include "content/fetchers/curl.h" +#include "content/fetchers.h" #include "content/fetchers/resource.h" #include "content/hlcache.h" #include "content/urldb.h" @@ -709,32 +709,23 @@ void nsbeos_pipe_message_top(BMessage *message, BWindow *_this, struct beos_scaf static void gui_poll(bool active) { - CURLMcode code; fd_set read_fd_set, write_fd_set, exc_fd_set; - int max_fd = 0; + int max_fd; struct timeval timeout; unsigned int fd_count = 0; bool block = true; bigtime_t next_schedule = 0; - // handle early deadlines - schedule_run(); + /* get any active fetcher fd */ + fetcher_fdset(&read_fd_set, &write_fd_set, &exc_fd_set, &max_fd); - FD_ZERO(&read_fd_set); - FD_ZERO(&write_fd_set); - FD_ZERO(&exc_fd_set); - - if (active) { - code = curl_multi_fdset(fetch_curl_multi, - &read_fd_set, - &write_fd_set, - &exc_fd_set, - &max_fd); - assert(code == CURLM_OK); - } + /* run the scheduler */ + schedule_run(); // our own event pipe FD_SET(sEventPipe[0], &read_fd_set); + + /** @todo Check if this max_fd should have + 1 */ max_fd = MAX(max_fd, sEventPipe[0] + 1); // If there are pending events elsewhere, we should not be blocking @@ -748,8 +739,10 @@ static void gui_poll(bool active) if (next_schedule < 0) next_schedule = 0; - } else //we're not allowed to sleep, there is other activity going on. + } else {//we're not allowed to sleep, there is other activity going on. + nsbeos_window_process_reformats(); block = false; + } /* LOG(("gui_poll: browser_reformat_pending:%d earliest_callback_timeout:%Ld" @@ -774,11 +767,6 @@ static void gui_poll(bool active) nsbeos_dispatch_event(message); } } - - schedule_run(); - - if (browser_reformat_pending) - nsbeos_window_process_reformats(); } |