diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-04-21 11:49:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-04-21 11:49:20 +0000 |
commit | 6c32edc3932553c01d329d026150046ebf95b38f (patch) | |
tree | f55fc7c5bfe653463ebd4e0531f458b0ef8006cf /src/peerinfo | |
parent | 5e07ad9cf3ec17e0b8d33b7686c81bbb5e79c986 (diff) | |
download | gnunet-6c32edc3932553c01d329d026150046ebf95b38f.tar.gz gnunet-6c32edc3932553c01d329d026150046ebf95b38f.zip |
move
Diffstat (limited to 'src/peerinfo')
-rw-r--r-- | src/peerinfo/Makefile.am | 3 | ||||
-rw-r--r-- | src/peerinfo/peerinfo_api.c | 239 | ||||
-rw-r--r-- | src/peerinfo/peerinfo_api_notify.c | 273 |
3 files changed, 275 insertions, 240 deletions
diff --git a/src/peerinfo/Makefile.am b/src/peerinfo/Makefile.am index 632a942de..a95eafba1 100644 --- a/src/peerinfo/Makefile.am +++ b/src/peerinfo/Makefile.am | |||
@@ -12,7 +12,8 @@ endif | |||
12 | lib_LTLIBRARIES = libgnunetpeerinfo.la | 12 | lib_LTLIBRARIES = libgnunetpeerinfo.la |
13 | 13 | ||
14 | libgnunetpeerinfo_la_SOURCES = \ | 14 | libgnunetpeerinfo_la_SOURCES = \ |
15 | peerinfo_api.c peerinfo.h | 15 | peerinfo_api.c peerinfo.h \ |
16 | peerinfo_api_notify.c | ||
16 | libgnunetpeerinfo_la_LIBADD = \ | 17 | libgnunetpeerinfo_la_LIBADD = \ |
17 | $(top_builddir)/src/hello/libgnunethello.la \ | 18 | $(top_builddir)/src/hello/libgnunethello.la \ |
18 | $(top_builddir)/src/util/libgnunetutil.la \ | 19 | $(top_builddir)/src/util/libgnunetutil.la \ |
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index 6fd538f0d..841f14074 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c | |||
@@ -324,245 +324,6 @@ GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic) | |||
324 | } | 324 | } |
325 | 325 | ||
326 | 326 | ||
327 | /** | ||
328 | * Context for the info handler. | ||
329 | */ | ||
330 | struct GNUNET_PEERINFO_NotifyContext | ||
331 | { | ||
332 | |||
333 | /** | ||
334 | * Our connection to the PEERINFO service. | ||
335 | */ | ||
336 | struct GNUNET_CLIENT_Connection *client; | ||
337 | |||
338 | /** | ||
339 | * Function to call with information. | ||
340 | */ | ||
341 | GNUNET_PEERINFO_Processor callback; | ||
342 | |||
343 | /** | ||
344 | * Closure for callback. | ||
345 | */ | ||
346 | void *callback_cls; | ||
347 | |||
348 | /** | ||
349 | * Handle to our initial request for message transmission to | ||
350 | * the peerinfo service. | ||
351 | */ | ||
352 | struct GNUNET_CLIENT_TransmitHandle *init; | ||
353 | |||
354 | /** | ||
355 | * Configuration. | ||
356 | */ | ||
357 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
358 | |||
359 | /** | ||
360 | * Scheduler. | ||
361 | */ | ||
362 | struct GNUNET_SCHEDULER_Handle *sched; | ||
363 | }; | ||
364 | |||
365 | |||
366 | /** | ||
367 | * Send a request to the peerinfo service to start being | ||
368 | * notified about all changes to peer information. | ||
369 | * | ||
370 | * @param nc our context | ||
371 | */ | ||
372 | static void | ||
373 | request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
374 | |||
375 | |||
376 | /** | ||
377 | * Read notifications from the client handle and pass them | ||
378 | * to the callback. | ||
379 | * | ||
380 | * @param nc our context | ||
381 | */ | ||
382 | static void | ||
383 | receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
384 | |||
385 | |||
386 | /** | ||
387 | * Receive a peerinfo information message, process it and | ||
388 | * go for more. | ||
389 | * | ||
390 | * @param cls closure | ||
391 | * @param msg message received, NULL on timeout or fatal error | ||
392 | */ | ||
393 | static void | ||
394 | process_notification (void *cls, | ||
395 | const struct | ||
396 | GNUNET_MessageHeader * msg) | ||
397 | { | ||
398 | struct GNUNET_PEERINFO_NotifyContext *nc = cls; | ||
399 | const struct InfoMessage *im; | ||
400 | const struct GNUNET_HELLO_Message *hello; | ||
401 | uint16_t ms; | ||
402 | |||
403 | if (msg == NULL) | ||
404 | { | ||
405 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
406 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
407 | request_notifications (nc); | ||
408 | return; | ||
409 | } | ||
410 | ms = ntohs (msg->size); | ||
411 | if ((ms < sizeof (struct InfoMessage)) || | ||
412 | (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_PEERINFO_INFO)) | ||
413 | { | ||
414 | GNUNET_break (0); | ||
415 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
416 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
417 | request_notifications (nc); | ||
418 | return; | ||
419 | } | ||
420 | im = (const struct InfoMessage *) msg; | ||
421 | hello = NULL; | ||
422 | if (ms > sizeof (struct InfoMessage) + sizeof (struct GNUNET_MessageHeader)) | ||
423 | { | ||
424 | hello = (const struct GNUNET_HELLO_Message *) &im[1]; | ||
425 | if (ms != sizeof (struct InfoMessage) + GNUNET_HELLO_size (hello)) | ||
426 | { | ||
427 | GNUNET_break (0); | ||
428 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
429 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
430 | request_notifications (nc); | ||
431 | return; | ||
432 | } | ||
433 | } | ||
434 | #if DEBUG_PEERINFO | ||
435 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
436 | "Received information about peer `%s' from peerinfo database\n", | ||
437 | GNUNET_i2s (&im->peer)); | ||
438 | #endif | ||
439 | nc->callback (nc->callback_cls, &im->peer, hello, ntohl (im->trust)); | ||
440 | receive_notifications (nc); | ||
441 | } | ||
442 | |||
443 | |||
444 | /** | ||
445 | * Read notifications from the client handle and pass them | ||
446 | * to the callback. | ||
447 | * | ||
448 | * @param nc our context | ||
449 | */ | ||
450 | static void | ||
451 | receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc) | ||
452 | { | ||
453 | GNUNET_CLIENT_receive (nc->client, | ||
454 | &process_notification, | ||
455 | nc, | ||
456 | GNUNET_TIME_UNIT_FOREVER_REL); | ||
457 | } | ||
458 | |||
459 | |||
460 | /** | ||
461 | * Transmit our init-notify request, start receiving. | ||
462 | * | ||
463 | * @param cls closure (our 'struct GNUNET_PEERINFO_NotifyContext') | ||
464 | * @param size number of bytes available in buf | ||
465 | * @param buf where the callee should write the message | ||
466 | * @return number of bytes written to buf | ||
467 | */ | ||
468 | static size_t | ||
469 | transmit_notify_request (void *cls, | ||
470 | size_t size, | ||
471 | void *buf) | ||
472 | { | ||
473 | struct GNUNET_PEERINFO_NotifyContext *nc = cls; | ||
474 | struct GNUNET_MessageHeader hdr; | ||
475 | |||
476 | nc->init = NULL; | ||
477 | if (buf == NULL) | ||
478 | { | ||
479 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
480 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
481 | request_notifications (nc); | ||
482 | return 0; | ||
483 | } | ||
484 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); | ||
485 | hdr.size = htons (sizeof (struct GNUNET_MessageHeader)); | ||
486 | hdr.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY); | ||
487 | memcpy (buf, &hdr, sizeof (struct GNUNET_MessageHeader)); | ||
488 | receive_notifications (nc); | ||
489 | return sizeof (struct GNUNET_MessageHeader); | ||
490 | } | ||
491 | |||
492 | |||
493 | /** | ||
494 | * Send a request to the peerinfo service to start being | ||
495 | * notified about all changes to peer information. | ||
496 | * | ||
497 | * @param nc our context | ||
498 | */ | ||
499 | static void | ||
500 | request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc) | ||
501 | { | ||
502 | GNUNET_assert (NULL == nc->init); | ||
503 | nc->init =GNUNET_CLIENT_notify_transmit_ready (nc->client, | ||
504 | sizeof (struct GNUNET_MessageHeader), | ||
505 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
506 | GNUNET_YES, | ||
507 | &transmit_notify_request, | ||
508 | nc); | ||
509 | } | ||
510 | |||
511 | |||
512 | /** | ||
513 | * Call a method whenever our known information about peers | ||
514 | * changes. Initially calls the given function for all known | ||
515 | * peers and then only signals changes. | ||
516 | * | ||
517 | * @param cfg configuration to use | ||
518 | * @param sched scheduler to use | ||
519 | * @param callback the method to call for each peer | ||
520 | * @param callback_cls closure for callback | ||
521 | * @return NULL on error | ||
522 | */ | ||
523 | struct GNUNET_PEERINFO_NotifyContext * | ||
524 | GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
525 | struct GNUNET_SCHEDULER_Handle *sched, | ||
526 | GNUNET_PEERINFO_Processor callback, | ||
527 | void *callback_cls) | ||
528 | { | ||
529 | struct GNUNET_PEERINFO_NotifyContext *nc; | ||
530 | struct GNUNET_CLIENT_Connection *client; | ||
531 | |||
532 | client = GNUNET_CLIENT_connect (sched, "peerinfo", cfg); | ||
533 | if (client == NULL) | ||
534 | { | ||
535 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
536 | _("Could not connect to `%s' service.\n"), "peerinfo"); | ||
537 | return NULL; | ||
538 | } | ||
539 | nc = GNUNET_malloc (sizeof (struct GNUNET_PEERINFO_NotifyContext)); | ||
540 | nc->sched = sched; | ||
541 | nc->cfg = cfg; | ||
542 | nc->client = client; | ||
543 | nc->callback = callback; | ||
544 | nc->callback_cls = callback_cls; | ||
545 | request_notifications (nc); | ||
546 | return nc; | ||
547 | } | ||
548 | |||
549 | |||
550 | /** | ||
551 | * Stop notifying about changes. | ||
552 | * | ||
553 | * @param nc context to stop notifying | ||
554 | */ | ||
555 | void | ||
556 | GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc) | ||
557 | { | ||
558 | if (NULL != nc->init) | ||
559 | { | ||
560 | GNUNET_CLIENT_notify_transmit_ready_cancel (nc->init); | ||
561 | nc->init = NULL; | ||
562 | } | ||
563 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
564 | GNUNET_free (nc); | ||
565 | } | ||
566 | 327 | ||
567 | 328 | ||
568 | /* end of peerinfo_api.c */ | 329 | /* end of peerinfo_api.c */ |
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c new file mode 100644 index 000000000..edcf4f7d0 --- /dev/null +++ b/src/peerinfo/peerinfo_api_notify.c | |||
@@ -0,0 +1,273 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2001, 2002, 2004, 2005, 2007, 2009, 2010 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 2, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file peerinfo/peerinfo_api_notify.c | ||
23 | * @brief notify API to access peerinfo service | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_client_lib.h" | ||
28 | #include "gnunet_peerinfo_service.h" | ||
29 | #include "gnunet_protocols.h" | ||
30 | #include "gnunet_time_lib.h" | ||
31 | #include "peerinfo.h" | ||
32 | |||
33 | /** | ||
34 | * Context for the info handler. | ||
35 | */ | ||
36 | struct GNUNET_PEERINFO_NotifyContext | ||
37 | { | ||
38 | |||
39 | /** | ||
40 | * Our connection to the PEERINFO service. | ||
41 | */ | ||
42 | struct GNUNET_CLIENT_Connection *client; | ||
43 | |||
44 | /** | ||
45 | * Function to call with information. | ||
46 | */ | ||
47 | GNUNET_PEERINFO_Processor callback; | ||
48 | |||
49 | /** | ||
50 | * Closure for callback. | ||
51 | */ | ||
52 | void *callback_cls; | ||
53 | |||
54 | /** | ||
55 | * Handle to our initial request for message transmission to | ||
56 | * the peerinfo service. | ||
57 | */ | ||
58 | struct GNUNET_CLIENT_TransmitHandle *init; | ||
59 | |||
60 | /** | ||
61 | * Configuration. | ||
62 | */ | ||
63 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
64 | |||
65 | /** | ||
66 | * Scheduler. | ||
67 | */ | ||
68 | struct GNUNET_SCHEDULER_Handle *sched; | ||
69 | }; | ||
70 | |||
71 | |||
72 | /** | ||
73 | * Send a request to the peerinfo service to start being | ||
74 | * notified about all changes to peer information. | ||
75 | * | ||
76 | * @param nc our context | ||
77 | */ | ||
78 | static void | ||
79 | request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
80 | |||
81 | |||
82 | /** | ||
83 | * Read notifications from the client handle and pass them | ||
84 | * to the callback. | ||
85 | * | ||
86 | * @param nc our context | ||
87 | */ | ||
88 | static void | ||
89 | receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
90 | |||
91 | |||
92 | /** | ||
93 | * Receive a peerinfo information message, process it and | ||
94 | * go for more. | ||
95 | * | ||
96 | * @param cls closure | ||
97 | * @param msg message received, NULL on timeout or fatal error | ||
98 | */ | ||
99 | static void | ||
100 | process_notification (void *cls, | ||
101 | const struct | ||
102 | GNUNET_MessageHeader * msg) | ||
103 | { | ||
104 | struct GNUNET_PEERINFO_NotifyContext *nc = cls; | ||
105 | const struct InfoMessage *im; | ||
106 | const struct GNUNET_HELLO_Message *hello; | ||
107 | uint16_t ms; | ||
108 | |||
109 | if (msg == NULL) | ||
110 | { | ||
111 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
112 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
113 | request_notifications (nc); | ||
114 | return; | ||
115 | } | ||
116 | ms = ntohs (msg->size); | ||
117 | if ((ms < sizeof (struct InfoMessage)) || | ||
118 | (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_PEERINFO_INFO)) | ||
119 | { | ||
120 | GNUNET_break (0); | ||
121 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
122 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
123 | request_notifications (nc); | ||
124 | return; | ||
125 | } | ||
126 | im = (const struct InfoMessage *) msg; | ||
127 | hello = NULL; | ||
128 | if (ms > sizeof (struct InfoMessage) + sizeof (struct GNUNET_MessageHeader)) | ||
129 | { | ||
130 | hello = (const struct GNUNET_HELLO_Message *) &im[1]; | ||
131 | if (ms != sizeof (struct InfoMessage) + GNUNET_HELLO_size (hello)) | ||
132 | { | ||
133 | GNUNET_break (0); | ||
134 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
135 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
136 | request_notifications (nc); | ||
137 | return; | ||
138 | } | ||
139 | } | ||
140 | #if DEBUG_PEERINFO | ||
141 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
142 | "Received information about peer `%s' from peerinfo database\n", | ||
143 | GNUNET_i2s (&im->peer)); | ||
144 | #endif | ||
145 | nc->callback (nc->callback_cls, &im->peer, hello, ntohl (im->trust)); | ||
146 | receive_notifications (nc); | ||
147 | } | ||
148 | |||
149 | |||
150 | /** | ||
151 | * Read notifications from the client handle and pass them | ||
152 | * to the callback. | ||
153 | * | ||
154 | * @param nc our context | ||
155 | */ | ||
156 | static void | ||
157 | receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc) | ||
158 | { | ||
159 | GNUNET_CLIENT_receive (nc->client, | ||
160 | &process_notification, | ||
161 | nc, | ||
162 | GNUNET_TIME_UNIT_FOREVER_REL); | ||
163 | } | ||
164 | |||
165 | |||
166 | /** | ||
167 | * Transmit our init-notify request, start receiving. | ||
168 | * | ||
169 | * @param cls closure (our 'struct GNUNET_PEERINFO_NotifyContext') | ||
170 | * @param size number of bytes available in buf | ||
171 | * @param buf where the callee should write the message | ||
172 | * @return number of bytes written to buf | ||
173 | */ | ||
174 | static size_t | ||
175 | transmit_notify_request (void *cls, | ||
176 | size_t size, | ||
177 | void *buf) | ||
178 | { | ||
179 | struct GNUNET_PEERINFO_NotifyContext *nc = cls; | ||
180 | struct GNUNET_MessageHeader hdr; | ||
181 | |||
182 | nc->init = NULL; | ||
183 | if (buf == NULL) | ||
184 | { | ||
185 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
186 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | ||
187 | request_notifications (nc); | ||
188 | return 0; | ||
189 | } | ||
190 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); | ||
191 | hdr.size = htons (sizeof (struct GNUNET_MessageHeader)); | ||
192 | hdr.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY); | ||
193 | memcpy (buf, &hdr, sizeof (struct GNUNET_MessageHeader)); | ||
194 | receive_notifications (nc); | ||
195 | return sizeof (struct GNUNET_MessageHeader); | ||
196 | } | ||
197 | |||
198 | |||
199 | /** | ||
200 | * Send a request to the peerinfo service to start being | ||
201 | * notified about all changes to peer information. | ||
202 | * | ||
203 | * @param nc our context | ||
204 | */ | ||
205 | static void | ||
206 | request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc) | ||
207 | { | ||
208 | GNUNET_assert (NULL == nc->init); | ||
209 | nc->init =GNUNET_CLIENT_notify_transmit_ready (nc->client, | ||
210 | sizeof (struct GNUNET_MessageHeader), | ||
211 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
212 | GNUNET_YES, | ||
213 | &transmit_notify_request, | ||
214 | nc); | ||
215 | } | ||
216 | |||
217 | |||
218 | /** | ||
219 | * Call a method whenever our known information about peers | ||
220 | * changes. Initially calls the given function for all known | ||
221 | * peers and then only signals changes. | ||
222 | * | ||
223 | * @param cfg configuration to use | ||
224 | * @param sched scheduler to use | ||
225 | * @param callback the method to call for each peer | ||
226 | * @param callback_cls closure for callback | ||
227 | * @return NULL on error | ||
228 | */ | ||
229 | struct GNUNET_PEERINFO_NotifyContext * | ||
230 | GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
231 | struct GNUNET_SCHEDULER_Handle *sched, | ||
232 | GNUNET_PEERINFO_Processor callback, | ||
233 | void *callback_cls) | ||
234 | { | ||
235 | struct GNUNET_PEERINFO_NotifyContext *nc; | ||
236 | struct GNUNET_CLIENT_Connection *client; | ||
237 | |||
238 | client = GNUNET_CLIENT_connect (sched, "peerinfo", cfg); | ||
239 | if (client == NULL) | ||
240 | { | ||
241 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
242 | _("Could not connect to `%s' service.\n"), "peerinfo"); | ||
243 | return NULL; | ||
244 | } | ||
245 | nc = GNUNET_malloc (sizeof (struct GNUNET_PEERINFO_NotifyContext)); | ||
246 | nc->sched = sched; | ||
247 | nc->cfg = cfg; | ||
248 | nc->client = client; | ||
249 | nc->callback = callback; | ||
250 | nc->callback_cls = callback_cls; | ||
251 | request_notifications (nc); | ||
252 | return nc; | ||
253 | } | ||
254 | |||
255 | |||
256 | /** | ||
257 | * Stop notifying about changes. | ||
258 | * | ||
259 | * @param nc context to stop notifying | ||
260 | */ | ||
261 | void | ||
262 | GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc) | ||
263 | { | ||
264 | if (NULL != nc->init) | ||
265 | { | ||
266 | GNUNET_CLIENT_notify_transmit_ready_cancel (nc->init); | ||
267 | nc->init = NULL; | ||
268 | } | ||
269 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); | ||
270 | GNUNET_free (nc); | ||
271 | } | ||
272 | |||
273 | /* end of peerinfo_api_notify.c */ | ||