aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-08-24 22:17:46 +0200
committerlurchi <lurchi@strangeplace.net>2017-08-24 22:17:46 +0200
commitfe7759b2428c183fe9595640abece0937ec88bcc (patch)
treed3fbbd50029f31c4b141a437b7f7bf9e3928e3d5 /src
parenta9a1f2b07fe8b15601b434756ba7ddb263978293 (diff)
downloadgnunet-fe7759b2428c183fe9595640abece0937ec88bcc.tar.gz
gnunet-fe7759b2428c183fe9595640abece0937ec88bcc.zip
fix behaviour of GNUNET_SCHEDULER_add_select on empty fdsets
if GNUNET_SCHEDULER_add_select is called with empty fdsets, the resulting task is now added to the pending_timeout queue instead of the pending queue. This way the driver will not know about the task.
Diffstat (limited to 'src')
-rw-r--r--src/util/scheduler.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 51833a78b..cbb48c3a4 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -1717,8 +1717,7 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1717 unsigned int read_nhandles_len, write_nhandles_len, 1717 unsigned int read_nhandles_len, write_nhandles_len,
1718 read_fhandles_len, write_fhandles_len; 1718 read_fhandles_len, write_fhandles_len;
1719 1719
1720 if ( (NULL == rs) && 1720 if (((NULL == rs) && (NULL == ws)) || ((0 == rs->nsds) && (0 == ws->nsds)))
1721 (NULL == ws) )
1722 return GNUNET_SCHEDULER_add_delayed_with_priority (delay, 1721 return GNUNET_SCHEDULER_add_delayed_with_priority (delay,
1723 prio, 1722 prio,
1724 task, 1723 task,
@@ -1759,7 +1758,6 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1759 &write_fhandles, 1758 &write_fhandles,
1760 &write_fhandles_len); 1759 &write_fhandles_len);
1761 } 1760 }
1762 GNUNET_assert (read_nhandles_len + write_nhandles_len > 0);
1763 init_fd_info (t, 1761 init_fd_info (t,
1764 read_nhandles, 1762 read_nhandles,
1765 read_nhandles_len, 1763 read_nhandles_len,