diff options
Diffstat (limited to 'src/dv/dv_api.c')
-rw-r--r-- | src/dv/dv_api.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c index 5932c7459..faf61df5e 100644 --- a/src/dv/dv_api.c +++ b/src/dv/dv_api.c | |||
@@ -426,6 +426,14 @@ handle_message_receipt (void *cls, | |||
426 | reconnect (sh); | 426 | reconnect (sh); |
427 | return; | 427 | return; |
428 | } | 428 | } |
429 | if (NULL == | ||
430 | GNUNET_CONTAINER_multipeermap_get (sh->peers, | ||
431 | &rm->sender)) | ||
432 | { | ||
433 | GNUNET_break (0); | ||
434 | reconnect (sh); | ||
435 | return; | ||
436 | } | ||
429 | sh->message_cb (sh->cls, | 437 | sh->message_cb (sh->cls, |
430 | &rm->sender, | 438 | &rm->sender, |
431 | ntohl (rm->distance), | 439 | ntohl (rm->distance), |
@@ -443,7 +451,7 @@ handle_message_receipt (void *cls, | |||
443 | peer = GNUNET_CONTAINER_multipeermap_get (sh->peers, | 451 | peer = GNUNET_CONTAINER_multipeermap_get (sh->peers, |
444 | &ack->target); | 452 | &ack->target); |
445 | if (NULL == peer) | 453 | if (NULL == peer) |
446 | return; /* this happens, just ignore */ | 454 | break; /* this happens, just ignore */ |
447 | for (th = peer->head; NULL != th; th = th->next) | 455 | for (th = peer->head; NULL != th; th = th->next) |
448 | { | 456 | { |
449 | if (th->uid != ntohl (ack->uid)) | 457 | if (th->uid != ntohl (ack->uid)) |
@@ -466,6 +474,9 @@ handle_message_receipt (void *cls, | |||
466 | reconnect (sh); | 474 | reconnect (sh); |
467 | break; | 475 | break; |
468 | } | 476 | } |
477 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
478 | "Received message, continuing receive loop for %p\n", | ||
479 | sh->client); | ||
469 | GNUNET_CLIENT_receive (sh->client, | 480 | GNUNET_CLIENT_receive (sh->client, |
470 | &handle_message_receipt, sh, | 481 | &handle_message_receipt, sh, |
471 | GNUNET_TIME_UNIT_FOREVER_REL); | 482 | GNUNET_TIME_UNIT_FOREVER_REL); |
@@ -499,6 +510,9 @@ transmit_start (void *cls, | |||
499 | start_message.size = htons (sizeof (struct GNUNET_MessageHeader)); | 510 | start_message.size = htons (sizeof (struct GNUNET_MessageHeader)); |
500 | start_message.type = htons (GNUNET_MESSAGE_TYPE_DV_START); | 511 | start_message.type = htons (GNUNET_MESSAGE_TYPE_DV_START); |
501 | memcpy (buf, &start_message, sizeof (start_message)); | 512 | memcpy (buf, &start_message, sizeof (start_message)); |
513 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
514 | "Transmitting START request, starting receive loop for %p\n", | ||
515 | sh->client); | ||
502 | GNUNET_CLIENT_receive (sh->client, | 516 | GNUNET_CLIENT_receive (sh->client, |
503 | &handle_message_receipt, sh, | 517 | &handle_message_receipt, sh, |
504 | GNUNET_TIME_UNIT_FOREVER_REL); | 518 | GNUNET_TIME_UNIT_FOREVER_REL); |
@@ -520,6 +534,9 @@ reconnect (struct GNUNET_DV_ServiceHandle *sh) | |||
520 | GNUNET_CLIENT_notify_transmit_ready_cancel (sh->th); | 534 | GNUNET_CLIENT_notify_transmit_ready_cancel (sh->th); |
521 | sh->th = NULL; | 535 | sh->th = NULL; |
522 | } | 536 | } |
537 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
538 | "Disconnecting from DV service at %p\n", | ||
539 | sh->client); | ||
523 | if (NULL != sh->client) | 540 | if (NULL != sh->client) |
524 | { | 541 | { |
525 | GNUNET_CLIENT_disconnect (sh->client); | 542 | GNUNET_CLIENT_disconnect (sh->client); |
@@ -643,10 +660,11 @@ GNUNET_DV_send (struct GNUNET_DV_ServiceHandle *sh, | |||
643 | return NULL; | 660 | return NULL; |
644 | } | 661 | } |
645 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 662 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
646 | "Asked to send %u bytes of type %u to %s\n", | 663 | "Asked to send %u bytes of type %u to %s via %p\n", |
647 | (unsigned int) ntohs (msg->size), | 664 | (unsigned int) ntohs (msg->size), |
648 | (unsigned int) ntohs (msg->type), | 665 | (unsigned int) ntohs (msg->type), |
649 | GNUNET_i2s (target)); | 666 | GNUNET_i2s (target), |
667 | sh->client); | ||
650 | peer = GNUNET_CONTAINER_multipeermap_get (sh->peers, | 668 | peer = GNUNET_CONTAINER_multipeermap_get (sh->peers, |
651 | target); | 669 | target); |
652 | if (NULL == peer) | 670 | if (NULL == peer) |