diff options
author | Nils Durner <durner@gnunet.org> | 2009-08-23 22:11:49 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2009-08-23 22:11:49 +0000 |
commit | 2518cfc0a86865ebe4d0550e0013ed52a494231b (patch) | |
tree | e9a130b782597e18bcff24a9fdab6e5c6aae1f9c /src/hostlist/hostlist-server.c | |
parent | 2ae973618f3b51fa9bbf5532eaa1352cafc24ecc (diff) | |
download | gnunet-2518cfc0a86865ebe4d0550e0013ed52a494231b.tar.gz gnunet-2518cfc0a86865ebe4d0550e0013ed52a494231b.zip |
low level network API
Diffstat (limited to 'src/hostlist/hostlist-server.c')
-rw-r--r-- | src/hostlist/hostlist-server.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index 5cc26c409..03e3c5d69 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c | |||
@@ -221,6 +221,9 @@ prepare_daemon () | |||
221 | fd_set rs; | 221 | fd_set rs; |
222 | fd_set ws; | 222 | fd_set ws; |
223 | fd_set es; | 223 | fd_set es; |
224 | struct GNUNET_NETWORK_FDSet *wrs; | ||
225 | struct GNUNET_NETWORK_FDSet *wws; | ||
226 | struct GNUNET_NETWORK_FDSet *wes; | ||
224 | int max; | 227 | int max; |
225 | unsigned long long timeout; | 228 | unsigned long long timeout; |
226 | int haveto; | 229 | int haveto; |
@@ -229,6 +232,9 @@ prepare_daemon () | |||
229 | FD_ZERO(&rs); | 232 | FD_ZERO(&rs); |
230 | FD_ZERO(&ws); | 233 | FD_ZERO(&ws); |
231 | FD_ZERO(&es); | 234 | FD_ZERO(&es); |
235 | wrs = GNUNET_NETWORK_fdset_create (); | ||
236 | wes = GNUNET_NETWORK_fdset_create (); | ||
237 | wws = GNUNET_NETWORK_fdset_create (); | ||
232 | max = -1; | 238 | max = -1; |
233 | GNUNET_assert (MHD_YES == | 239 | GNUNET_assert (MHD_YES == |
234 | MHD_get_fdset (daemon_handle, | 240 | MHD_get_fdset (daemon_handle, |
@@ -241,17 +247,22 @@ prepare_daemon () | |||
241 | tv.value = (uint64_t) timeout; | 247 | tv.value = (uint64_t) timeout; |
242 | else | 248 | else |
243 | tv = GNUNET_TIME_UNIT_FOREVER_REL; | 249 | tv = GNUNET_TIME_UNIT_FOREVER_REL; |
250 | GNUNET_NETWORK_fdset_copy_native (wrs, &rs, max); | ||
251 | GNUNET_NETWORK_fdset_copy_native (wws, &ws, max); | ||
252 | GNUNET_NETWORK_fdset_copy_native (wes, &es, max); | ||
244 | hostlist_task | 253 | hostlist_task |
245 | = GNUNET_SCHEDULER_add_select (sched, | 254 | = GNUNET_SCHEDULER_add_select (sched, |
246 | GNUNET_NO, | 255 | GNUNET_NO, |
247 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 256 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
248 | GNUNET_SCHEDULER_NO_TASK, | 257 | GNUNET_SCHEDULER_NO_TASK, |
249 | tv, | 258 | tv, |
250 | max, | 259 | wrs, |
251 | &rs, | 260 | wws, |
252 | &ws, | ||
253 | &run_daemon, | 261 | &run_daemon, |
254 | NULL); | 262 | NULL); |
263 | GNUNET_NETWORK_fdset_destroy (wrs); | ||
264 | GNUNET_NETWORK_fdset_destroy (wws); | ||
265 | GNUNET_NETWORK_fdset_destroy (wes); | ||
255 | } | 266 | } |
256 | 267 | ||
257 | 268 | ||