diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-06-26 18:56:42 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-06-26 19:05:59 +0100 |
commit | 8944edd649e74e4864f36d7293921385ba5ca2c7 (patch) | |
tree | 1a901e8323944bcee35b972328812ed559b87950 /beos/gui.cpp | |
parent | 1b7aa7ffe53843f072e3de5e28bdf06faa7980b9 (diff) | |
download | netsurf-8944edd649e74e4864f36d7293921385ba5ca2c7.tar.gz netsurf-8944edd649e74e4864f36d7293921385ba5ca2c7.tar.bz2 |
convert all frontends to scheduled fetch operation
Diffstat (limited to 'beos/gui.cpp')
-rw-r--r-- | beos/gui.cpp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp index db4374512..8518ba1ac 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -46,7 +46,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" @@ -702,32 +702,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 @@ -741,8 +732,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" @@ -767,11 +760,6 @@ static void gui_poll(bool active) nsbeos_dispatch_event(message); } } - - schedule_run(); - - if (browser_reformat_pending) - nsbeos_window_process_reformats(); } |