diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-03-12 13:29:05 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-03-12 13:29:05 +0000 |
commit | a6f43190ab793b3487da2133735e166e337000c4 (patch) | |
tree | fc2dacc6a36f3ec04cf86a14cdea9c5bdf45274f /src/peerinfo/peerinfo_api.c | |
parent | 61cfd3340e67672f351ab92dab7da72dca058c79 (diff) | |
download | gnunet-a6f43190ab793b3487da2133735e166e337000c4.tar.gz gnunet-a6f43190ab793b3487da2133735e166e337000c4.zip |
cancel pending write if we are just dead anyway
Diffstat (limited to 'src/peerinfo/peerinfo_api.c')
-rw-r--r-- | src/peerinfo/peerinfo_api.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index 5531ede97..2a7c990e4 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c | |||
@@ -56,7 +56,7 @@ copy_and_free (void *cls, size_t size, void *buf) | |||
56 | ntohs (msg->type), "peerinfo"); | 56 | ntohs (msg->type), "peerinfo"); |
57 | #endif | 57 | #endif |
58 | GNUNET_free (msg); | 58 | GNUNET_free (msg); |
59 | GNUNET_CLIENT_disconnect (cc->client); | 59 | GNUNET_CLIENT_disconnect (cc->client, GNUNET_NO); |
60 | GNUNET_free (cc); | 60 | GNUNET_free (cc); |
61 | return 0; | 61 | return 0; |
62 | } | 62 | } |
@@ -64,7 +64,7 @@ copy_and_free (void *cls, size_t size, void *buf) | |||
64 | GNUNET_assert (size >= msize); | 64 | GNUNET_assert (size >= msize); |
65 | memcpy (buf, msg, msize); | 65 | memcpy (buf, msg, msize); |
66 | GNUNET_free (msg); | 66 | GNUNET_free (msg); |
67 | GNUNET_CLIENT_disconnect (cc->client); | 67 | GNUNET_CLIENT_disconnect (cc->client, GNUNET_YES); |
68 | GNUNET_free (cc); | 68 | GNUNET_free (cc); |
69 | return msize; | 69 | return msize; |
70 | } | 70 | } |
@@ -175,7 +175,7 @@ info_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
175 | _("Failed to receive response from `%s' service.\n"), | 175 | _("Failed to receive response from `%s' service.\n"), |
176 | "peerinfo"); | 176 | "peerinfo"); |
177 | ic->callback (ic->callback_cls, NULL, NULL, 1); | 177 | ic->callback (ic->callback_cls, NULL, NULL, 1); |
178 | GNUNET_CLIENT_disconnect (ic->client); | 178 | GNUNET_CLIENT_disconnect (ic->client, GNUNET_NO); |
179 | GNUNET_free (ic); | 179 | GNUNET_free (ic); |
180 | return; | 180 | return; |
181 | } | 181 | } |
@@ -186,7 +186,7 @@ info_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
186 | "Received end of list of peers from peerinfo database\n"); | 186 | "Received end of list of peers from peerinfo database\n"); |
187 | #endif | 187 | #endif |
188 | ic->callback (ic->callback_cls, NULL, NULL, 0); | 188 | ic->callback (ic->callback_cls, NULL, NULL, 0); |
189 | GNUNET_CLIENT_disconnect (ic->client); | 189 | GNUNET_CLIENT_disconnect (ic->client, GNUNET_NO); |
190 | GNUNET_free (ic); | 190 | GNUNET_free (ic); |
191 | return; | 191 | return; |
192 | } | 192 | } |
@@ -196,7 +196,7 @@ info_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
196 | { | 196 | { |
197 | GNUNET_break (0); | 197 | GNUNET_break (0); |
198 | ic->callback (ic->callback_cls, NULL, NULL, 2); | 198 | ic->callback (ic->callback_cls, NULL, NULL, 2); |
199 | GNUNET_CLIENT_disconnect (ic->client); | 199 | GNUNET_CLIENT_disconnect (ic->client, GNUNET_NO); |
200 | GNUNET_free (ic); | 200 | GNUNET_free (ic); |
201 | return; | 201 | return; |
202 | } | 202 | } |
@@ -209,7 +209,7 @@ info_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
209 | { | 209 | { |
210 | GNUNET_break (0); | 210 | GNUNET_break (0); |
211 | ic->callback (ic->callback_cls, NULL, NULL, 2); | 211 | ic->callback (ic->callback_cls, NULL, NULL, 2); |
212 | GNUNET_CLIENT_disconnect (ic->client); | 212 | GNUNET_CLIENT_disconnect (ic->client, GNUNET_NO); |
213 | GNUNET_free (ic); | 213 | GNUNET_free (ic); |
214 | return; | 214 | return; |
215 | } | 215 | } |
@@ -307,7 +307,7 @@ GNUNET_PEERINFO_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
307 | ihc)) | 307 | ihc)) |
308 | { | 308 | { |
309 | GNUNET_break (0); | 309 | GNUNET_break (0); |
310 | GNUNET_CLIENT_disconnect (ihc->client); | 310 | GNUNET_CLIENT_disconnect (ihc->client, GNUNET_NO); |
311 | GNUNET_free (ihc); | 311 | GNUNET_free (ihc); |
312 | return NULL; | 312 | return NULL; |
313 | } | 313 | } |
@@ -323,7 +323,7 @@ GNUNET_PEERINFO_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
323 | void | 323 | void |
324 | GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic) | 324 | GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic) |
325 | { | 325 | { |
326 | GNUNET_CLIENT_disconnect (ic->client); | 326 | GNUNET_CLIENT_disconnect (ic->client, GNUNET_NO); |
327 | GNUNET_free (ic); | 327 | GNUNET_free (ic); |
328 | } | 328 | } |
329 | 329 | ||
@@ -406,7 +406,7 @@ process_notification (void *cls, | |||
406 | 406 | ||
407 | if (msg == NULL) | 407 | if (msg == NULL) |
408 | { | 408 | { |
409 | GNUNET_CLIENT_disconnect (nc->client); | 409 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); |
410 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | 410 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); |
411 | request_notifications (nc); | 411 | request_notifications (nc); |
412 | return; | 412 | return; |
@@ -416,7 +416,7 @@ process_notification (void *cls, | |||
416 | (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_PEERINFO_INFO)) | 416 | (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_PEERINFO_INFO)) |
417 | { | 417 | { |
418 | GNUNET_break (0); | 418 | GNUNET_break (0); |
419 | GNUNET_CLIENT_disconnect (nc->client); | 419 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); |
420 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | 420 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); |
421 | request_notifications (nc); | 421 | request_notifications (nc); |
422 | return; | 422 | return; |
@@ -429,7 +429,7 @@ process_notification (void *cls, | |||
429 | if (ms != sizeof (struct InfoMessage) + GNUNET_HELLO_size (hello)) | 429 | if (ms != sizeof (struct InfoMessage) + GNUNET_HELLO_size (hello)) |
430 | { | 430 | { |
431 | GNUNET_break (0); | 431 | GNUNET_break (0); |
432 | GNUNET_CLIENT_disconnect (nc->client); | 432 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); |
433 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | 433 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); |
434 | request_notifications (nc); | 434 | request_notifications (nc); |
435 | return; | 435 | return; |
@@ -480,7 +480,7 @@ transmit_notify_request (void *cls, | |||
480 | nc->init = NULL; | 480 | nc->init = NULL; |
481 | if (buf == NULL) | 481 | if (buf == NULL) |
482 | { | 482 | { |
483 | GNUNET_CLIENT_disconnect (nc->client); | 483 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); |
484 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); | 484 | nc->client = GNUNET_CLIENT_connect (nc->sched, "peerinfo", nc->cfg); |
485 | request_notifications (nc); | 485 | request_notifications (nc); |
486 | return 0; | 486 | return 0; |
@@ -564,7 +564,7 @@ GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc) | |||
564 | GNUNET_CLIENT_notify_transmit_ready_cancel (nc->init); | 564 | GNUNET_CLIENT_notify_transmit_ready_cancel (nc->init); |
565 | nc->init = NULL; | 565 | nc->init = NULL; |
566 | } | 566 | } |
567 | GNUNET_CLIENT_disconnect (nc->client); | 567 | GNUNET_CLIENT_disconnect (nc->client, GNUNET_NO); |
568 | GNUNET_free (nc); | 568 | GNUNET_free (nc); |
569 | } | 569 | } |
570 | 570 | ||