aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-26 13:58:45 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-26 13:58:45 +0000
commit24b29e7ed4cc4b068d45bfcdda8a4c2c7e3d458c (patch)
tree7c9bce2900c862487d94ac74156a6af3bf8fb435
parentb7284d6399d1486fe09b5858bf7a2ab70a7cbc90 (diff)
downloadgnunet-24b29e7ed4cc4b068d45bfcdda8a4c2c7e3d458c.tar.gz
gnunet-24b29e7ed4cc4b068d45bfcdda8a4c2c7e3d458c.zip
-better error reporting
-rw-r--r--src/core/gnunet-service-core_neighbours.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c
index f96d66d6e..be818768a 100644
--- a/src/core/gnunet-service-core_neighbours.c
+++ b/src/core/gnunet-service-core_neighbours.c
@@ -124,7 +124,7 @@ struct Neighbour
124 124
125 125
126/** 126/**
127 * Map of peer identities to 'struct Neighbour'. 127 * Map of peer identities to `struct Neighbour`.
128 */ 128 */
129static struct GNUNET_CONTAINER_MultiPeerMap *neighbours; 129static struct GNUNET_CONTAINER_MultiPeerMap *neighbours;
130 130
@@ -368,6 +368,9 @@ handle_transport_notify_connect (void *cls,
368 { 368 {
369 /* duplicate connect notification!? */ 369 /* duplicate connect notification!? */
370 GNUNET_break (0); 370 GNUNET_break (0);
371 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
372 "Peer %s exists already\n",
373 GNUNET_i2s (peer));
371 return; 374 return;
372 } 375 }
373 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 376 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -415,6 +418,9 @@ handle_transport_notify_disconnect (void *cls,
415 if (NULL == n) 418 if (NULL == n)
416 { 419 {
417 GNUNET_break (0); 420 GNUNET_break (0);
421 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
422 "Peer %s not found\n",
423 GNUNET_i2s (peer));
418 return; 424 return;
419 } 425 }
420 free_neighbour (n); 426 free_neighbour (n);
@@ -452,6 +458,9 @@ handle_transport_receive (void *cls,
452 { 458 {
453 /* received message from peer that is not connected!? */ 459 /* received message from peer that is not connected!? */
454 GNUNET_break (0); 460 GNUNET_break (0);
461 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
462 "Peer %s not found\n",
463 GNUNET_i2s (peer));
455 return; 464 return;
456 } 465 }
457 type = ntohs (message->type); 466 type = ntohs (message->type);
@@ -503,6 +512,9 @@ GSC_NEIGHBOURS_transmit (const struct GNUNET_PeerIdentity *target,
503 if (NULL == n) 512 if (NULL == n)
504 { 513 {
505 GNUNET_break (0); 514 GNUNET_break (0);
515 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
516 "Peer %s not found\n",
517 GNUNET_i2s (target));
506 return; 518 return;
507 } 519 }
508 msize = ntohs (msg->size); 520 msize = ntohs (msg->size);
@@ -521,8 +533,7 @@ GSC_NEIGHBOURS_transmit (const struct GNUNET_PeerIdentity *target,
521 533
522 534
523/** 535/**
524 * One of our neighbours has excess bandwidth, 536 * One of our neighbours has excess bandwidth, remember this.
525 * remember this.
526 * 537 *
527 * @param cls NULL 538 * @param cls NULL
528 * @param pid identity of the peer with excess bandwidth 539 * @param pid identity of the peer with excess bandwidth
@@ -533,15 +544,18 @@ handle_transport_notify_excess_bw (void *cls,
533{ 544{
534 struct Neighbour *n; 545 struct Neighbour *n;
535 546
536 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
537 "Peer %s has excess bandwidth available\n",
538 GNUNET_i2s (pid));
539 n = find_neighbour (pid); 547 n = find_neighbour (pid);
540 if (NULL == n) 548 if (NULL == n)
541 { 549 {
542 GNUNET_break (0); 550 GNUNET_break (0);
551 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
552 "Peer %s not found\n",
553 GNUNET_i2s (pid));
543 return; 554 return;
544 } 555 }
556 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
557 "Peer %s has excess bandwidth available\n",
558 GNUNET_i2s (pid));
545 n->has_excess_bandwidth = GNUNET_YES; 559 n->has_excess_bandwidth = GNUNET_YES;
546 GSC_SESSIONS_solicit (pid); 560 GSC_SESSIONS_solicit (pid);
547} 561}
@@ -562,6 +576,9 @@ GSC_NEIGHBOURS_get_queue_size (const struct GNUNET_PeerIdentity *target)
562 if (NULL == n) 576 if (NULL == n)
563 { 577 {
564 GNUNET_break (0); 578 GNUNET_break (0);
579 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
580 "Peer %s not found\n",
581 GNUNET_i2s (target));
565 return UINT_MAX; 582 return UINT_MAX;
566 } 583 }
567 return n->queue_size; 584 return n->queue_size;
@@ -583,6 +600,9 @@ GSC_NEIGHBOURS_check_excess_bandwidth (const struct GNUNET_PeerIdentity *target)
583 if (NULL == n) 600 if (NULL == n)
584 { 601 {
585 GNUNET_break (0); 602 GNUNET_break (0);
603 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
604 "Peer %s not found\n",
605 GNUNET_i2s (target));
586 return GNUNET_SYSERR; 606 return GNUNET_SYSERR;
587 } 607 }
588 return n->has_excess_bandwidth; 608 return n->has_excess_bandwidth;