[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 15/45: fix initFdInfo; rename to init_fd_info
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 15/45: fix initFdInfo; rename to init_fd_info |
Date: |
Sun, 31 Dec 2017 00:37:02 +0100 |
This is an automated email from the git hooks/post-receive script.
lurchi pushed a commit to branch master
in repository gnunet.
commit 564ca7f14fce740e848b68bf78c358eca53d2c9e
Author: lurchi <address@hidden>
AuthorDate: Wed Aug 9 13:50:09 2017 +0200
fix initFdInfo; rename to init_fd_info
---
src/util/scheduler.c | 47 ++++++++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 21 deletions(-)
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 8a7155d07..c7471ee0b 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -684,57 +684,62 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority
p)
void
-initFdInfo(struct GNUNET_SCHEDULER_Task *t,
- const struct GNUNET_NETWORK_Handle *read_nh,
- const struct GNUNET_NETWORK_Handle *write_nh,
- const struct GNUNET_DISK_FileHandle *read_fh,
- const struct GNUNET_DISK_FileHandle *write_fh)
+init_fd_info (struct GNUNET_SCHEDULER_Task *t,
+ const struct GNUNET_NETWORK_Handle *read_nh,
+ const struct GNUNET_NETWORK_Handle *write_nh,
+ const struct GNUNET_DISK_FileHandle *read_fh,
+ const struct GNUNET_DISK_FileHandle *write_fh)
{
// either only network handles or only file handles are allowed
GNUNET_assert (!((NULL != read_nh || NULL != write_nh) && (NULL != read_fh
|| NULL != write_fh)));
if (NULL != read_nh && NULL != write_nh)
{
+ struct GNUNET_SCHEDULER_FdInfo *fds = GNUNET_new_array (2, struct
GNUNET_SCHEDULER_FdInfo);
+ struct GNUNET_SCHEDULER_FdInfo read_fdi = {.fd = read_nh, .et =
GNUNET_SCHEDULER_ET_IN, .sock = GNUNET_NETWORK_get_fd (read_nh)};
+ struct GNUNET_SCHEDULER_FdInfo write_fdi = {.fd = write_nh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = GNUNET_NETWORK_get_fd (write_nh)};
+ fds[0] = read_fdi;
+ fds[1] = write_fdi;
+ t->fds = fds;
t->fds_len = 2;
- t->fds = GNUNET_new_array (2, struct GNUNET_SCHEDULER_FdInfo);
- const struct GNUNET_SCHEDULER_FdInfo read_fdi = { .fd = read_nh, .et =
GNUNET_SCHEDULER_ET_IN, .sock = GNUNET_NETWORK_get_fd (read_nh)};
- const struct GNUNET_SCHEDULER_FdInfo write_fdi = { .fd = write_nh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = GNUNET_NETWORK_get_fd (write_nh)};
-
- const struct GNUNET_SCHEDULER_FdInfo array[2] = {read_fdi, write_fdi};
- t->fds = array;
}
else if (NULL != read_fh && NULL != write_fh)
{
+ struct GNUNET_SCHEDULER_FdInfo *fds = GNUNET_new_array (2, struct
GNUNET_SCHEDULER_FdInfo);
+ struct GNUNET_SCHEDULER_FdInfo read_fdi = {.fh = read_fh, .et =
GNUNET_SCHEDULER_ET_IN, .sock = read_fh->fd};
+ struct GNUNET_SCHEDULER_FdInfo write_fdi = {.fh = write_fh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = write_fh->fd};
+ fds[0] = read_fdi;
+ fds[1] = write_fdi;
+ t->fds = fds;
t->fds_len = 2;
- t->fds = GNUNET_new_array (2, struct GNUNET_SCHEDULER_FdInfo);
- const struct GNUNET_SCHEDULER_FdInfo read_fdi = { .fh = read_fh, .et =
GNUNET_SCHEDULER_ET_IN};
- const struct GNUNET_SCHEDULER_FdInfo write_fdi = { .fh = write_fh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = GNUNET_NETWORK_get_fd (write_nh)};
- const struct GNUNET_SCHEDULER_FdInfo array[2] = {read_fdi, write_fdi};
- t->fds = array;
}
else if (NULL != read_nh)
{
- struct GNUNET_SCHEDULER_FdInfo read_fdi = { .fd = read_nh, .et =
GNUNET_SCHEDULER_ET_IN, .sock = GNUNET_NETWORK_get_fd (read_nh)};
+ struct GNUNET_SCHEDULER_FdInfo read_fdi = {.fd = read_nh, .et =
GNUNET_SCHEDULER_ET_IN, .sock = GNUNET_NETWORK_get_fd (read_nh)};
t->fdx = read_fdi;
t->fds = &t->fdx;
+ t->read_fd = t->fdx.sock;
}
else if (NULL != write_nh)
{
- struct GNUNET_SCHEDULER_FdInfo write_fdi = { .fd = write_nh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = GNUNET_NETWORK_get_fd (write_nh)};
+ struct GNUNET_SCHEDULER_FdInfo write_fdi = {.fd = write_nh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = GNUNET_NETWORK_get_fd (write_nh)};
t->fdx = write_fdi;
t->fds = &t->fdx;
+ t->write_fd = t->fdx.sock;
}
else if (NULL != read_fh)
{
- struct GNUNET_SCHEDULER_FdInfo read_fdi = { .fh = read_fh, .et =
GNUNET_SCHEDULER_ET_IN, .sock = read_fh->fd};
+ struct GNUNET_SCHEDULER_FdInfo read_fdi = {.fh = read_fh, .et =
GNUNET_SCHEDULER_ET_IN, .sock = read_fh->fd};
t->fdx = read_fdi;
t->fds = &t->fdx;
+ t->read_fd = t->fdx.sock;
}
else if (NULL != write_fh)
{
- struct GNUNET_SCHEDULER_FdInfo write_fdi = { .fh = write_fh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = write_fh->fd};
+ struct GNUNET_SCHEDULER_FdInfo write_fdi = {.fh = write_fh, .et =
GNUNET_SCHEDULER_ET_OUT, .sock = write_fh->fd};
t->fdx = write_fdi;
t->fds = &t->fdx;
+ t->write_fd = t->fdx.sock;
}
}
@@ -1207,7 +1212,7 @@ add_without_sets (struct GNUNET_TIME_Relative delay,
GNUNET_assert (NULL != active_task);
GNUNET_assert (NULL != task);
t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
- initFdInfo (t, read_nh, write_nh, read_fh, write_fh);
+ init_fd_info (t, read_nh, write_nh, read_fh, write_fh);
t->callback = task;
t->callback_cls = task_cls;
#if DEBUG_FDS
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 03/45: adapt add_without_sets to scheduler driver API; reimplement initFdInfo, (continued)
- [GNUnet-SVN] [gnunet] 03/45: adapt add_without_sets to scheduler driver API; reimplement initFdInfo, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 05/45: Call to set_wakeup added after tasks added/removed to/from pending_timeout, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 04/45: Nearly finished. Call to set_wakeup missing in case of tasks added to pending_timeout, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 08/45: fix warnings, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 09/45: add missing DLL insert, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 07/45: make input of getters const (needed for new scheduler API), gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 13/45: Merge branch 'refactoring-scheduler' of ssh://gnunet.org/gnunet, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 18/45: cosmetic fixes, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 17/45: test_scheduler passing; new API function GNUNET_SCHEDULER_check_lifeness, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 16/45: lifeness checks; shutdown now working; checkSignal not passing yet, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 15/45: fix initFdInfo; rename to init_fd_info,
gnunet <=
- [GNUnet-SVN] [gnunet] 10/45: fix segfault and pending_timeout logic, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 11/45: Smaller changes. Changed order when set_wakeup is called after some task is removed from pending_timeout, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 20/45: remove unnecessary set_wakup call, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 14/45: fix indentation; remove unneeded set_wakeup call, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 19/45: fix compilation of debug code enabled by DEBUG_FDS; fix indentation, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 25/45: fix off-by-one error that prevented reading from stdin, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 36/45: fix behaviour of GNUNET_SCHEDULER_add_select on empty fdsets, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 39/45: Don't consider restart when the test action already finished, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 35/45: NULL-initialize array pointers, gnunet, 2017/12/30
- [GNUnet-SVN] [gnunet] 34/45: cleanup, gnunet, 2017/12/30