diff options
author | LRN <lrn1986@gmail.com> | 2012-07-13 16:24:27 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2012-07-13 16:24:27 +0000 |
commit | 1e30a9c42a35e67efd684e7a5455858fa72775ee (patch) | |
tree | 0d169442e97e2f8a13d3a81ae08e190b0d003071 /src/util/network.c | |
parent | 2f7f317e9da9ec375e04a115d88ce27fadc8f839 (diff) | |
download | gnunet-1e30a9c42a35e67efd684e7a5455858fa72775ee.tar.gz gnunet-1e30a9c42a35e67efd684e7a5455858fa72775ee.zip |
Safer handling of corner-cases in w32 select
Diffstat (limited to 'src/util/network.c')
-rw-r--r-- | src/util/network.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/util/network.c b/src/util/network.c index c61704be9..6d8b2869a 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -1523,10 +1523,22 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
1523 | LOG (GNUNET_ERROR_TYPE_DEBUG, "nfds: %d, handles: %d, will wait: %llu ms\n", | 1523 | LOG (GNUNET_ERROR_TYPE_DEBUG, "nfds: %d, handles: %d, will wait: %llu ms\n", |
1524 | nfds, nhandles, (unsigned long long) ms_total); | 1524 | nfds, nhandles, (unsigned long long) ms_total); |
1525 | if (nhandles) | 1525 | if (nhandles) |
1526 | { | ||
1526 | returncode = | 1527 | returncode = |
1527 | WaitForMultipleObjects (nhandles, handle_array, FALSE, ms_total); | 1528 | WaitForMultipleObjects (nhandles, handle_array, FALSE, ms_total); |
1528 | LOG (GNUNET_ERROR_TYPE_DEBUG, "WaitForMultipleObjects Returned : %d\n", | 1529 | LOG (GNUNET_ERROR_TYPE_DEBUG, "WaitForMultipleObjects Returned : %d\n", |
1529 | returncode); | 1530 | returncode); |
1531 | } | ||
1532 | else if (nfds > 0) | ||
1533 | { | ||
1534 | i = (int) WaitForSingleObject (select_finished_event, INFINITE); | ||
1535 | returncode = WAIT_TIMEOUT; | ||
1536 | } | ||
1537 | else | ||
1538 | { | ||
1539 | /* Shouldn't come this far. If it does - investigate. */ | ||
1540 | GNUNET_assert (0); | ||
1541 | } | ||
1530 | 1542 | ||
1531 | if (nfds > 0) | 1543 | if (nfds > 0) |
1532 | { | 1544 | { |