diff options
Diffstat (limited to 'src/lib/eventloop.c')
-rw-r--r-- | src/lib/eventloop.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c index 7cc2e2e7..9c74f12d 100644 --- a/src/lib/eventloop.c +++ b/src/lib/eventloop.c | |||
@@ -195,8 +195,8 @@ GNUNET_GTK_main_loop_get_object (struct GNUNET_GTK_MainLoop *ml, | |||
195 | * @param tc scheduler context | 195 | * @param tc scheduler context |
196 | */ | 196 | */ |
197 | static void | 197 | static void |
198 | gnunet_gtk_dispatch_task (void *cls, | 198 | dispatch_gtk_task (void *cls, |
199 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 199 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
200 | { | 200 | { |
201 | struct GNUNET_GTK_MainLoop *ml = cls; | 201 | struct GNUNET_GTK_MainLoop *ml = cls; |
202 | g_main_context_dispatch (ml->gmc); | 202 | g_main_context_dispatch (ml->gmc); |
@@ -552,7 +552,6 @@ gnunet_gtk_select (void *cls, | |||
552 | poll_result = g_poll (ml->cached_poll_array, | 552 | poll_result = g_poll (ml->cached_poll_array, |
553 | fd_counter + need_gfds, | 553 | fd_counter + need_gfds, |
554 | delay); | 554 | delay); |
555 | |||
556 | #if DEBUG_NETWORK | 555 | #if DEBUG_NETWORK |
557 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 556 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
558 | "g_poll returned : %d\n", | 557 | "g_poll returned : %d\n", |
@@ -568,9 +567,10 @@ gnunet_gtk_select (void *cls, | |||
568 | max_priority, | 567 | max_priority, |
569 | &ml->cached_poll_array[fd_counter], | 568 | &ml->cached_poll_array[fd_counter], |
570 | need_gfds)) | 569 | need_gfds)) |
571 | GNUNET_SCHEDULER_add_continuation (gnunet_gtk_dispatch_task, ml, | 570 | GNUNET_SCHEDULER_add_continuation (&dispatch_gtk_task, ml, |
572 | GNUNET_SCHEDULER_REASON_STARTUP); | 571 | GNUNET_SCHEDULER_REASON_STARTUP); |
573 | 572 | ||
573 | /* Now map back GNUnet scheduler events ... */ | ||
574 | #if !WINDOWS | 574 | #if !WINDOWS |
575 | if (NULL != rfds) | 575 | if (NULL != rfds) |
576 | GNUNET_NETWORK_fdset_zero (rfds); | 576 | GNUNET_NETWORK_fdset_zero (rfds); |
@@ -582,11 +582,14 @@ gnunet_gtk_select (void *cls, | |||
582 | { | 582 | { |
583 | int set[3]; | 583 | int set[3]; |
584 | 584 | ||
585 | if ((set[0] = FD_ISSET (ml->cached_poll_array[i].fd, &aread))) | 585 | if ((set[0] = (FD_ISSET (ml->cached_poll_array[i].fd, &aread) && |
586 | (0 != (ml->cached_poll_array[i].revents & (G_IO_IN | G_IO_HUP | G_IO_ERR)))))) | ||
586 | GNUNET_NETWORK_fdset_set_native (rfds, ml->cached_poll_array[i].fd); | 587 | GNUNET_NETWORK_fdset_set_native (rfds, ml->cached_poll_array[i].fd); |
587 | if ((set[1] = FD_ISSET (ml->cached_poll_array[i].fd, &awrite))) | 588 | if ((set[1] = (FD_ISSET (ml->cached_poll_array[i].fd, &awrite) && |
589 | (0 != (ml->cached_poll_array[i].revents & (G_IO_OUT | G_IO_ERR)))))) | ||
588 | GNUNET_NETWORK_fdset_set_native (wfds, ml->cached_poll_array[i].fd); | 590 | GNUNET_NETWORK_fdset_set_native (wfds, ml->cached_poll_array[i].fd); |
589 | if ((set[2] = FD_ISSET (ml->cached_poll_array[i].fd, &aexcept))) | 591 | if ((set[2] = (FD_ISSET (ml->cached_poll_array[i].fd, &aexcept) && |
592 | (0 != (ml->cached_poll_array[i].revents & G_IO_ERR))))) | ||
590 | GNUNET_NETWORK_fdset_set_native (efds, ml->cached_poll_array[i].fd); | 593 | GNUNET_NETWORK_fdset_set_native (efds, ml->cached_poll_array[i].fd); |
591 | if (set[0] || set[1] || set[2]) | 594 | if (set[0] || set[1] || set[2]) |
592 | result++; | 595 | result++; |