summaryrefslogtreecommitdiff
path: root/beos/beos_gui.cpp
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-07 00:15:19 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-07 00:15:19 +0000
commit6fd280ad2e1c95107f491745136c9df74e864768 (patch)
tree6ca1541cbbcf9bb104ad588136d282f0d66fd5c9 /beos/beos_gui.cpp
parent2ab25ce7dba16d98d059ca5011e7b9cac2ed9cd9 (diff)
downloadnetsurf-6fd280ad2e1c95107f491745136c9df74e864768.tar.gz
netsurf-6fd280ad2e1c95107f491745136c9df74e864768.tar.bz2
- fix using undefined fd_sets in case active was false. Looks like I was too quick at copy-pasting gtk code. This should fix the busy-loop behaviour on Haiku.
- remove dead gtk code. svn path=/trunk/netsurf/; revision=5502
Diffstat (limited to 'beos/beos_gui.cpp')
-rw-r--r--beos/beos_gui.cpp71
1 files changed, 4 insertions, 67 deletions
diff --git a/beos/beos_gui.cpp b/beos/beos_gui.cpp
index 4d1c86ed6..a21c021b5 100644
--- a/beos/beos_gui.cpp
+++ b/beos/beos_gui.cpp
@@ -631,11 +631,12 @@ void gui_poll(bool active)
if (browser_reformat_pending)
block = false;
+ FD_ZERO(&read_fd_set);
+ FD_ZERO(&write_fd_set);
+ FD_ZERO(&exc_fd_set);
+
if (active) {
fetch_poll();
- FD_ZERO(&read_fd_set);
- FD_ZERO(&write_fd_set);
- FD_ZERO(&exc_fd_set);
code = curl_multi_fdset(fetch_curl_multi,
&read_fd_set,
&write_fd_set,
@@ -669,70 +670,6 @@ void gui_poll(bool active)
nsbeos_dispatch_event(message);
}
-
-/*
- for (unsigned int i = 0; fd_count && i < max_fd; i++) {
- g_main_context_remove_poll(0, fd_list[i]);
- free(fd_list[i]);
- fd_count--;
- }
-*/
-
-#if 0 /* GTK */
- CURLMcode code;
- fd_set read_fd_set, write_fd_set, exc_fd_set;
- int max_fd;
- GPollFD *fd_list[1000];
- unsigned int fd_count = 0;
- bool block = true;
-
- if (browser_reformat_pending)
- block = false;
-
- if (active) {
- fetch_poll();
- FD_ZERO(&read_fd_set);
- FD_ZERO(&write_fd_set);
- FD_ZERO(&exc_fd_set);
- code = curl_multi_fdset(fetch_curl_multi,
- &read_fd_set,
- &write_fd_set,
- &exc_fd_set,
- &max_fd);
- assert(code == CURLM_OK);
- for (int i = 0; i <= max_fd; i++) {
- if (FD_ISSET(i, &read_fd_set)) {
- GPollFD *fd = malloc(sizeof *fd);
- fd->fd = i;
- fd->events = G_IO_IN | G_IO_HUP | G_IO_ERR;
- g_main_context_add_poll(0, fd, 0);
- fd_list[fd_count++] = fd;
- }
- if (FD_ISSET(i, &write_fd_set)) {
- GPollFD *fd = malloc(sizeof *fd);
- fd->fd = i;
- fd->events = G_IO_OUT | G_IO_ERR;
- g_main_context_add_poll(0, fd, 0);
- fd_list[fd_count++] = fd;
- }
- if (FD_ISSET(i, &exc_fd_set)) {
- GPollFD *fd = malloc(sizeof *fd);
- fd->fd = i;
- fd->events = G_IO_ERR;
- g_main_context_add_poll(0, fd, 0);
- fd_list[fd_count++] = fd;
- }
- }
- }
-
- beos_main_iteration_do(block);
-
- for (unsigned int i = 0; i != fd_count; i++) {
- g_main_context_remove_poll(0, fd_list[i]);
- free(fd_list[i]);
- }
-#endif
-
schedule_run();
if (browser_reformat_pending)