diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/common_allocation.c | 5 | ||||
-rw-r--r-- | src/util/configuration.c | 1 | ||||
-rw-r--r-- | src/util/crypto_hash.c | 6 | ||||
-rw-r--r-- | src/util/network.c | 86 | ||||
-rw-r--r-- | src/util/scheduler.c | 17 |
5 files changed, 61 insertions, 54 deletions
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index be2538c3f..1c55d72b5 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -475,8 +475,8 @@ GNUNET_xgrow_ (void **old, | |||
475 | */ | 475 | */ |
476 | int | 476 | int |
477 | GNUNET_asprintf (char **buf, | 477 | GNUNET_asprintf (char **buf, |
478 | const char *format, | 478 | const char *format, |
479 | ...) | 479 | ...) |
480 | { | 480 | { |
481 | int ret; | 481 | int ret; |
482 | va_list args; | 482 | va_list args; |
@@ -484,6 +484,7 @@ GNUNET_asprintf (char **buf, | |||
484 | va_start (args, format); | 484 | va_start (args, format); |
485 | ret = VSNPRINTF (NULL, 0, format, args); | 485 | ret = VSNPRINTF (NULL, 0, format, args); |
486 | va_end (args); | 486 | va_end (args); |
487 | GNUNET_assert (ret >= 0); | ||
487 | *buf = GNUNET_malloc (ret + 1); | 488 | *buf = GNUNET_malloc (ret + 1); |
488 | va_start (args, format); | 489 | va_start (args, format); |
489 | ret = VSPRINTF (*buf, format, args); | 490 | ret = VSPRINTF (*buf, format, args); |
diff --git a/src/util/configuration.c b/src/util/configuration.c index 7f1d98902..25eeaf80f 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -421,7 +421,6 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
421 | size_t m_size; | 421 | size_t m_size; |
422 | size_t c_size; | 422 | size_t c_size; |
423 | 423 | ||
424 | |||
425 | /* Pass1 : calculate the buffer size required */ | 424 | /* Pass1 : calculate the buffer size required */ |
426 | m_size = 0; | 425 | m_size = 0; |
427 | for (sec = cfg->sections; NULL != sec; sec = sec->next) | 426 | for (sec = cfg->sections; NULL != sec; sec = sec->next) |
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index 20c7ca7ff..cce9cf82a 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c | |||
@@ -69,9 +69,9 @@ GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode *block, | |||
69 | char *np; | 69 | char *np; |
70 | 70 | ||
71 | np = GNUNET_STRINGS_data_to_string ((const unsigned char *) block, | 71 | np = GNUNET_STRINGS_data_to_string ((const unsigned char *) block, |
72 | sizeof (struct GNUNET_HashCode), | 72 | sizeof (struct GNUNET_HashCode), |
73 | (char*) result, | 73 | (char *) result, |
74 | sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1); | 74 | sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1); |
75 | GNUNET_assert (NULL != np); | 75 | GNUNET_assert (NULL != np); |
76 | *np = '\0'; | 76 | *np = '\0'; |
77 | } | 77 | } |
diff --git a/src/util/network.c b/src/util/network.c index 973878f93..0cb1529a6 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -91,8 +91,8 @@ GNUNET_NETWORK_test_pf (int pf) | |||
91 | if (EAFNOSUPPORT == errno) | 91 | if (EAFNOSUPPORT == errno) |
92 | return GNUNET_NO; | 92 | return GNUNET_NO; |
93 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 93 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
94 | "Failed to create test socket: %s\n", | 94 | "Failed to create test socket: %s\n", |
95 | STRERROR (errno)); | 95 | STRERROR (errno)); |
96 | return GNUNET_SYSERR; | 96 | return GNUNET_SYSERR; |
97 | } | 97 | } |
98 | #if WINDOWS | 98 | #if WINDOWS |
@@ -128,21 +128,20 @@ GNUNET_NETWORK_shorten_unixpath (char *unixpath) | |||
128 | if (slen < upm) | 128 | if (slen < upm) |
129 | return unixpath; /* no shortening required */ | 129 | return unixpath; /* no shortening required */ |
130 | GNUNET_CRYPTO_hash (unixpath, slen, &sh); | 130 | GNUNET_CRYPTO_hash (unixpath, slen, &sh); |
131 | while (16 + | 131 | while (16 + strlen (unixpath) >= upm) |
132 | strlen (unixpath) >= upm) | ||
133 | { | 132 | { |
134 | if (NULL == (end = strrchr (unixpath, '/'))) | 133 | if (NULL == (end = strrchr (unixpath, '/'))) |
135 | { | 134 | { |
136 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 135 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
137 | _("Unable to shorten unix path `%s' while keeping name unique\n"), | 136 | _("Unable to shorten unix path `%s' while keeping name unique\n"), |
138 | unixpath); | 137 | unixpath); |
139 | GNUNET_free (unixpath); | 138 | GNUNET_free (unixpath); |
140 | return NULL; | 139 | return NULL; |
141 | } | 140 | } |
142 | *end = '\0'; | 141 | *end = '\0'; |
143 | } | 142 | } |
144 | GNUNET_CRYPTO_hash_to_enc (&sh, &ae); | 143 | GNUNET_CRYPTO_hash_to_enc (&sh, &ae); |
145 | strncat (unixpath, (char*) ae.encoding, 16); | 144 | strncat (unixpath, (char *) ae.encoding, 16); |
146 | return unixpath; | 145 | return unixpath; |
147 | } | 146 | } |
148 | 147 | ||
@@ -239,7 +238,6 @@ GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, | |||
239 | int flags = fcntl (fd->fd, F_GETFL); | 238 | int flags = fcntl (fd->fd, F_GETFL); |
240 | 239 | ||
241 | if (flags == -1) | 240 | if (flags == -1) |
242 | |||
243 | { | 241 | { |
244 | LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, | 242 | LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, |
245 | "fcntl"); | 243 | "fcntl"); |
@@ -311,7 +309,7 @@ socket_set_nosigpipe (const struct GNUNET_NETWORK_Handle *h) | |||
311 | 309 | ||
312 | if (0 != | 310 | if (0 != |
313 | setsockopt (h->fd, SOL_SOCKET, SO_NOSIGPIPE, | 311 | setsockopt (h->fd, SOL_SOCKET, SO_NOSIGPIPE, |
314 | (const void *) &abs_value, | 312 | (const void *) &abs_value, |
315 | sizeof (abs_value))) | 313 | sizeof (abs_value))) |
316 | LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt"); | 314 | LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt"); |
317 | } | 315 | } |
@@ -342,8 +340,10 @@ socket_set_nodelay (const struct GNUNET_NETWORK_Handle *h) | |||
342 | const char *abs_value = "1"; | 340 | const char *abs_value = "1"; |
343 | 341 | ||
344 | if (0 != | 342 | if (0 != |
345 | setsockopt (h->fd, IPPROTO_TCP, TCP_NODELAY, | 343 | setsockopt (h->fd, |
346 | (const void *) abs_value, | 344 | IPPROTO_TCP, |
345 | TCP_NODELAY, | ||
346 | (const void *) abs_value, | ||
347 | sizeof (abs_value))) | 347 | sizeof (abs_value))) |
348 | LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, | 348 | LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, |
349 | "setsockopt"); | 349 | "setsockopt"); |
@@ -365,7 +365,7 @@ socket_set_nodelay (const struct GNUNET_NETWORK_Handle *h) | |||
365 | */ | 365 | */ |
366 | static int | 366 | static int |
367 | initialize_network_handle (struct GNUNET_NETWORK_Handle *h, | 367 | initialize_network_handle (struct GNUNET_NETWORK_Handle *h, |
368 | int af, | 368 | int af, |
369 | int type) | 369 | int type) |
370 | { | 370 | { |
371 | int eno; | 371 | int eno; |
@@ -409,7 +409,7 @@ initialize_network_handle (struct GNUNET_NETWORK_Handle *h, | |||
409 | #ifdef AF_UNIX | 409 | #ifdef AF_UNIX |
410 | && (af != AF_UNIX) | 410 | && (af != AF_UNIX) |
411 | #endif | 411 | #endif |
412 | ) | 412 | ) |
413 | socket_set_nodelay (h); | 413 | socket_set_nodelay (h); |
414 | return GNUNET_OK; | 414 | return GNUNET_OK; |
415 | } | 415 | } |
@@ -426,7 +426,7 @@ initialize_network_handle (struct GNUNET_NETWORK_Handle *h, | |||
426 | struct GNUNET_NETWORK_Handle * | 426 | struct GNUNET_NETWORK_Handle * |
427 | GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, | 427 | GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, |
428 | struct sockaddr *address, | 428 | struct sockaddr *address, |
429 | socklen_t *address_len) | 429 | socklen_t *address_len) |
430 | { | 430 | { |
431 | struct GNUNET_NETWORK_Handle *ret; | 431 | struct GNUNET_NETWORK_Handle *ret; |
432 | int eno; | 432 | int eno; |
@@ -443,7 +443,7 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, | |||
443 | 443 | ||
444 | if (0 == gsn) | 444 | if (0 == gsn) |
445 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 445 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
446 | "Accepting connection on `%s'\n", | 446 | "Accepting connection on `%s'\n", |
447 | GNUNET_a2s ((const struct sockaddr *) &name, | 447 | GNUNET_a2s ((const struct sockaddr *) &name, |
448 | namelen)); | 448 | namelen)); |
449 | } | 449 | } |
@@ -491,9 +491,11 @@ GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
491 | const int on = 1; | 491 | const int on = 1; |
492 | 492 | ||
493 | if (AF_INET6 == desc->af) | 493 | if (AF_INET6 == desc->af) |
494 | if (setsockopt (desc->fd, IPPROTO_IPV6, IPV6_V6ONLY, | 494 | if (setsockopt (desc->fd, |
495 | (const void *) &on, | 495 | IPPROTO_IPV6, |
496 | sizeof (on))) | 496 | IPV6_V6ONLY, |
497 | (const void *) &on, | ||
498 | sizeof (on))) | ||
497 | LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, | 499 | LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, |
498 | "setsockopt"); | 500 | "setsockopt"); |
499 | } | 501 | } |
@@ -593,8 +595,8 @@ GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc) | |||
593 | if (0 != unlink (dirname)) | 595 | if (0 != unlink (dirname)) |
594 | { | 596 | { |
595 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, | 597 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, |
596 | "unlink", | 598 | "unlink", |
597 | dirname); | 599 | dirname); |
598 | } | 600 | } |
599 | else | 601 | else |
600 | { | 602 | { |
@@ -1209,8 +1211,8 @@ GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | |||
1209 | to->handles_size, | 1211 | to->handles_size, |
1210 | from->handles_pos * 2); | 1212 | from->handles_pos * 2); |
1211 | GNUNET_memcpy (to->handles, | 1213 | GNUNET_memcpy (to->handles, |
1212 | from->handles, | 1214 | from->handles, |
1213 | from->handles_pos * sizeof (struct GNUNET_NETWORK_Handle *)); | 1215 | from->handles_pos * sizeof (struct GNUNET_NETWORK_Handle *)); |
1214 | to->handles_pos = from->handles_pos; | 1216 | to->handles_pos = from->handles_pos; |
1215 | #endif | 1217 | #endif |
1216 | } | 1218 | } |
@@ -1327,9 +1329,9 @@ GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | |||
1327 | int fd; | 1329 | int fd; |
1328 | 1330 | ||
1329 | GNUNET_assert (GNUNET_OK == | 1331 | GNUNET_assert (GNUNET_OK == |
1330 | GNUNET_DISK_internal_file_handle_ (h, | 1332 | GNUNET_DISK_internal_file_handle_ (h, |
1331 | &fd, | 1333 | &fd, |
1332 | sizeof (int))); | 1334 | sizeof (int))); |
1333 | FD_SET (fd, | 1335 | FD_SET (fd, |
1334 | &fds->sds); | 1336 | &fds->sds); |
1335 | fds->nsds = GNUNET_MAX (fd + 1, | 1337 | fds->nsds = GNUNET_MAX (fd + 1, |
@@ -1707,7 +1709,7 @@ initialize_select_thread () | |||
1707 | */ | 1709 | */ |
1708 | int | 1710 | int |
1709 | GNUNET_NETWORK_test_port_free (int ipproto, | 1711 | GNUNET_NETWORK_test_port_free (int ipproto, |
1710 | uint16_t port) | 1712 | uint16_t port) |
1711 | { | 1713 | { |
1712 | struct GNUNET_NETWORK_Handle *socket; | 1714 | struct GNUNET_NETWORK_Handle *socket; |
1713 | int bind_status; | 1715 | int bind_status; |
@@ -1718,37 +1720,35 @@ GNUNET_NETWORK_test_port_free (int ipproto, | |||
1718 | struct addrinfo *ai; | 1720 | struct addrinfo *ai; |
1719 | 1721 | ||
1720 | GNUNET_snprintf (open_port_str, | 1722 | GNUNET_snprintf (open_port_str, |
1721 | sizeof (open_port_str), | 1723 | sizeof (open_port_str), |
1722 | "%u", | 1724 | "%u", |
1723 | (unsigned int) port); | 1725 | (unsigned int) port); |
1724 | socktype = (IPPROTO_TCP == ipproto) | 1726 | socktype = (IPPROTO_TCP == ipproto) ? SOCK_STREAM : SOCK_DGRAM; |
1725 | ? SOCK_STREAM | ||
1726 | : SOCK_DGRAM; | ||
1727 | ret = NULL; | 1727 | ret = NULL; |
1728 | memset (&hint, 0, sizeof (hint)); | 1728 | memset (&hint, 0, sizeof (hint)); |
1729 | hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */ | 1729 | hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */ |
1730 | hint.ai_socktype = socktype; | 1730 | hint.ai_socktype = socktype; |
1731 | hint.ai_protocol = ipproto; | 1731 | hint.ai_protocol = ipproto; |
1732 | hint.ai_addrlen = 0; | 1732 | hint.ai_addrlen = 0; |
1733 | hint.ai_addr = NULL; | 1733 | hint.ai_addr = NULL; |
1734 | hint.ai_canonname = NULL; | 1734 | hint.ai_canonname = NULL; |
1735 | hint.ai_next = NULL; | 1735 | hint.ai_next = NULL; |
1736 | hint.ai_flags = AI_PASSIVE | AI_NUMERICSERV; /* Wild card address */ | 1736 | hint.ai_flags = AI_PASSIVE | AI_NUMERICSERV; /* Wild card address */ |
1737 | GNUNET_assert (0 == getaddrinfo (NULL, | 1737 | GNUNET_assert (0 == getaddrinfo (NULL, |
1738 | open_port_str, | 1738 | open_port_str, |
1739 | &hint, | 1739 | &hint, |
1740 | &ret)); | 1740 | &ret)); |
1741 | bind_status = GNUNET_NO; | 1741 | bind_status = GNUNET_NO; |
1742 | for (ai = ret; NULL != ai; ai = ai->ai_next) | 1742 | for (ai = ret; NULL != ai; ai = ai->ai_next) |
1743 | { | 1743 | { |
1744 | socket = GNUNET_NETWORK_socket_create (ai->ai_family, | 1744 | socket = GNUNET_NETWORK_socket_create (ai->ai_family, |
1745 | ai->ai_socktype, | 1745 | ai->ai_socktype, |
1746 | ai->ai_protocol); | 1746 | ai->ai_protocol); |
1747 | if (NULL == socket) | 1747 | if (NULL == socket) |
1748 | continue; | 1748 | continue; |
1749 | bind_status = GNUNET_NETWORK_socket_bind (socket, | 1749 | bind_status = GNUNET_NETWORK_socket_bind (socket, |
1750 | ai->ai_addr, | 1750 | ai->ai_addr, |
1751 | ai->ai_addrlen); | 1751 | ai->ai_addrlen); |
1752 | GNUNET_NETWORK_socket_close (socket); | 1752 | GNUNET_NETWORK_socket_close (socket); |
1753 | if (GNUNET_OK != bind_status) | 1753 | if (GNUNET_OK != bind_status) |
1754 | break; | 1754 | break; |
@@ -1808,7 +1808,7 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
1808 | (tv.tv_sec * GNUNET_TIME_UNIT_SECONDS.rel_value_us)); | 1808 | (tv.tv_sec * GNUNET_TIME_UNIT_SECONDS.rel_value_us)); |
1809 | } | 1809 | } |
1810 | return select (nfds, | 1810 | return select (nfds, |
1811 | (NULL != rfds) ? &rfds->sds : NULL, | 1811 | (NULL != rfds) ? &rfds->sds : NULL, |
1812 | (NULL != wfds) ? &wfds->sds : NULL, | 1812 | (NULL != wfds) ? &wfds->sds : NULL, |
1813 | (NULL != efds) ? &efds->sds : NULL, | 1813 | (NULL != efds) ? &efds->sds : NULL, |
1814 | (timeout.rel_value_us == | 1814 | (timeout.rel_value_us == |
@@ -2178,7 +2178,7 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
2178 | { | 2178 | { |
2179 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2179 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2180 | "Adding the socket event to the array as %d\n", | 2180 | "Adding the socket event to the array as %d\n", |
2181 | nhandles); | 2181 | nhandles); |
2182 | handle_array[nhandles++] = select_finished_event; | 2182 | handle_array[nhandles++] = select_finished_event; |
2183 | if (timeout.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) | 2183 | if (timeout.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
2184 | { | 2184 | { |
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index fecbc0de5..9d37231e7 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -756,8 +756,9 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
756 | t->fds = fdi; | 756 | t->fds = fdi; |
757 | if (1 == read_nh_len) | 757 | if (1 == read_nh_len) |
758 | { | 758 | { |
759 | GNUNET_assert (NULL != read_nh); | ||
760 | GNUNET_assert (NULL != *read_nh); | ||
759 | fdi->fd = *read_nh; | 761 | fdi->fd = *read_nh; |
760 | GNUNET_assert (NULL != fdi->fd); | ||
761 | fdi->et = GNUNET_SCHEDULER_ET_IN; | 762 | fdi->et = GNUNET_SCHEDULER_ET_IN; |
762 | fdi->sock = GNUNET_NETWORK_get_fd (*read_nh); | 763 | fdi->sock = GNUNET_NETWORK_get_fd (*read_nh); |
763 | t->read_fd = fdi->sock; | 764 | t->read_fd = fdi->sock; |
@@ -765,8 +766,9 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
765 | } | 766 | } |
766 | else if (1 == write_nh_len) | 767 | else if (1 == write_nh_len) |
767 | { | 768 | { |
769 | GNUNET_assert (NULL != write_nh); | ||
770 | GNUNET_assert (NULL != *write_nh); | ||
768 | fdi->fd = *write_nh; | 771 | fdi->fd = *write_nh; |
769 | GNUNET_assert (NULL != fdi->fd); | ||
770 | fdi->et = GNUNET_SCHEDULER_ET_OUT; | 772 | fdi->et = GNUNET_SCHEDULER_ET_OUT; |
771 | fdi->sock = GNUNET_NETWORK_get_fd (*write_nh); | 773 | fdi->sock = GNUNET_NETWORK_get_fd (*write_nh); |
772 | t->read_fd = -1; | 774 | t->read_fd = -1; |
@@ -774,8 +776,9 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
774 | } | 776 | } |
775 | else if (1 == read_fh_len) | 777 | else if (1 == read_fh_len) |
776 | { | 778 | { |
779 | GNUNET_assert (NULL != read_fh); | ||
780 | GNUNET_assert (NULL != *read_fh); | ||
777 | fdi->fh = *read_fh; | 781 | fdi->fh = *read_fh; |
778 | GNUNET_assert (NULL != fdi->fh); | ||
779 | fdi->et = GNUNET_SCHEDULER_ET_IN; | 782 | fdi->et = GNUNET_SCHEDULER_ET_IN; |
780 | fdi->sock = (*read_fh)->fd; // FIXME: does not work under WIN32 | 783 | fdi->sock = (*read_fh)->fd; // FIXME: does not work under WIN32 |
781 | t->read_fd = fdi->sock; | 784 | t->read_fd = fdi->sock; |
@@ -783,8 +786,9 @@ init_fd_info (struct GNUNET_SCHEDULER_Task *t, | |||
783 | } | 786 | } |
784 | else | 787 | else |
785 | { | 788 | { |
789 | GNUNET_assert (NULL != write_fh); | ||
790 | GNUNET_assert (NULL != *write_fh); | ||
786 | fdi->fh = *write_fh; | 791 | fdi->fh = *write_fh; |
787 | GNUNET_assert (NULL != fdi->fh); | ||
788 | fdi->et = GNUNET_SCHEDULER_ET_OUT; | 792 | fdi->et = GNUNET_SCHEDULER_ET_OUT; |
789 | fdi->sock = (*write_fh)->fd; // FIXME: does not work under WIN32 | 793 | fdi->sock = (*write_fh)->fd; // FIXME: does not work under WIN32 |
790 | t->read_fd = -1; | 794 | t->read_fd = -1; |
@@ -1750,8 +1754,11 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | |||
1750 | const struct GNUNET_DISK_FileHandle **write_fhandles; | 1754 | const struct GNUNET_DISK_FileHandle **write_fhandles; |
1751 | unsigned int read_nhandles_len, write_nhandles_len, | 1755 | unsigned int read_nhandles_len, write_nhandles_len, |
1752 | read_fhandles_len, write_fhandles_len; | 1756 | read_fhandles_len, write_fhandles_len; |
1757 | int no_fdsets = (NULL == rs) && (NULL == ws); | ||
1758 | int no_socket_descriptors = | ||
1759 | ((NULL != rs) && (0 == rs->nsds)) && ((NULL != ws) && (0 == ws->nsds)); | ||
1753 | 1760 | ||
1754 | if (((NULL == rs) && (NULL == ws)) || ((0 == rs->nsds) && (0 == ws->nsds))) | 1761 | if (no_fdsets || no_socket_descriptors) |
1755 | return GNUNET_SCHEDULER_add_delayed_with_priority (delay, | 1762 | return GNUNET_SCHEDULER_add_delayed_with_priority (delay, |
1756 | prio, | 1763 | prio, |
1757 | task, | 1764 | task, |