From 6fd280ad2e1c95107f491745136c9df74e864768 Mon Sep 17 00:00:00 2001 From: François Revel Date: Tue, 7 Oct 2008 00:15:19 +0000 Subject: - 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 --- beos/beos_gui.cpp | 71 ++++--------------------------------------------------- 1 file changed, 4 insertions(+), 67 deletions(-) (limited to 'beos/beos_gui.cpp') 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) -- cgit v1.2.3