diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 12:55:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 12:55:55 +0000 |
commit | 0c2c4e85c608575e389f3c97d1f893676bd14417 (patch) | |
tree | e20cdbf26d084e0cb9c138d4133df700aece8ab5 | |
parent | 370bb4ad5397b04139cdb89f4d7c6466b8118f31 (diff) | |
download | gnunet-gtk-0c2c4e85c608575e389f3c97d1f893676bd14417.tar.gz gnunet-gtk-0c2c4e85c608575e389f3c97d1f893676bd14417.zip |
some code cleanup
-rw-r--r-- | src/lib/eventloop.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c index 5815c210..5b364934 100644 --- a/src/lib/eventloop.c +++ b/src/lib/eventloop.c | |||
@@ -532,14 +532,14 @@ gnunet_gtk_select (void *cls, | |||
532 | } | 532 | } |
533 | 533 | ||
534 | if (pre_ret > 0) | 534 | if (pre_ret > 0) |
535 | { | 535 | { |
536 | #if DEBUG_NETWORK | 536 | #if DEBUG_NETWORK |
537 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 537 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
538 | "pre_ret is %d, setting delay to 0\n", | 538 | "pre_ret is %d, setting delay to 0\n", |
539 | pre_ret); | 539 | pre_ret); |
540 | #endif | 540 | #endif |
541 | delay = 0; | 541 | delay = 0; |
542 | } | 542 | } |
543 | 543 | ||
544 | #if DEBUG_NETWORK | 544 | #if DEBUG_NETWORK |
545 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 545 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -560,29 +560,33 @@ gnunet_gtk_select (void *cls, | |||
560 | * from within a task (currently we're not in a task, but in a select() call, remember) | 560 | * from within a task (currently we're not in a task, but in a select() call, remember) |
561 | * Startup reason is used to pass the scheduler sanity check. | 561 | * Startup reason is used to pass the scheduler sanity check. |
562 | */ | 562 | */ |
563 | if (TRUE == g_main_context_check (ml->gmc, ml->max_priority, &ml->cached_poll_array[fd_counter], need_gfds)) | 563 | if (TRUE == g_main_context_check (ml->gmc, |
564 | ml->max_priority, | ||
565 | &ml->cached_poll_array[fd_counter], | ||
566 | need_gfds)) | ||
564 | GNUNET_SCHEDULER_add_continuation (gnunet_gtk_dispatch_task, ml, | 567 | GNUNET_SCHEDULER_add_continuation (gnunet_gtk_dispatch_task, ml, |
565 | GNUNET_SCHEDULER_REASON_STARTUP); | 568 | GNUNET_SCHEDULER_REASON_STARTUP); |
566 | 569 | ||
567 | #if !WINDOWS | 570 | #if !WINDOWS |
568 | if (rfds) | 571 | if (NULL != rfds) |
569 | GNUNET_NETWORK_fdset_zero (rfds); | 572 | GNUNET_NETWORK_fdset_zero (rfds); |
570 | if (wfds) | 573 | if (NULL != wfds) |
571 | GNUNET_NETWORK_fdset_zero (wfds); | 574 | GNUNET_NETWORK_fdset_zero (wfds); |
572 | if (efds) | 575 | if (NULL != efds) |
573 | GNUNET_NETWORK_fdset_zero (efds); | 576 | GNUNET_NETWORK_fdset_zero (efds); |
574 | for (i = 0; i < fd_counter; i++) | 577 | for (i = 0; i < fd_counter; i++) |
575 | { | 578 | { |
576 | int set[3]; | 579 | int set[3]; |
577 | if ((set[0] = FD_ISSET (ml->cached_poll_array[i].fd, &aread))) | 580 | |
578 | FD_SET (ml->cached_poll_array[i].fd, &rfds->sds); | 581 | if ((set[0] = FD_ISSET (ml->cached_poll_array[i].fd, &aread))) |
579 | if ((set[1] = FD_ISSET (ml->cached_poll_array[i].fd, &awrite))) | 582 | GNUNET_NETWORK_fdset_set_native (rfds, ml->cached_poll_array[i].fd); |
580 | FD_SET (ml->cached_poll_array[i].fd, &wfds->sds); | 583 | if ((set[1] = FD_ISSET (ml->cached_poll_array[i].fd, &awrite))) |
581 | if ((set[2] = FD_ISSET (ml->cached_poll_array[i].fd, &aexcept))) | 584 | GNUNET_NETWORK_fdset_set_native (wfds, ml->cached_poll_array[i].fd); |
582 | FD_SET (ml->cached_poll_array[i].fd, &efds->sds); | 585 | if ((set[2] = FD_ISSET (ml->cached_poll_array[i].fd, &aexcept))) |
583 | if (set[0] || set[1] || set[2]) | 586 | GNUNET_NETWORK_fdset_set_native (efds, ml->cached_poll_array[i].fd); |
584 | result += 1; | 587 | if (set[0] || set[1] || set[2]) |
585 | } | 588 | result++; |
589 | } | ||
586 | #else | 590 | #else |
587 | if (socks > 0) | 591 | if (socks > 0) |
588 | { | 592 | { |