diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-05-25 10:21:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-05-25 10:21:22 +0000 |
commit | 1e30974ec0ae6efd6516ec14d27d339339dad08c (patch) | |
tree | 96c68d41e92a91afc17c26e9ac1ef516c5cac156 /src/core/core_api.c | |
parent | 1184451771a924952811002dad0b03b063ab3681 (diff) | |
download | gnunet-1e30974ec0ae6efd6516ec14d27d339339dad08c.tar.gz gnunet-1e30974ec0ae6efd6516ec14d27d339339dad08c.zip |
clean up logging, set rim ID always, even if neighbour was not found
Diffstat (limited to 'src/core/core_api.c')
-rw-r--r-- | src/core/core_api.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index 195e94e29..daf93b3c4 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -578,10 +578,9 @@ request_next_transmission (struct PeerRecord *pr) | |||
578 | smr->queue_size = htonl (pr->queue_size); | 578 | smr->queue_size = htonl (pr->queue_size); |
579 | smr->size = htons (th->msize); | 579 | smr->size = htons (th->msize); |
580 | smr->smr_id = htons (th->smr_id = pr->smr_id_gen++); | 580 | smr->smr_id = htons (th->smr_id = pr->smr_id_gen++); |
581 | GNUNET_CONTAINER_DLL_insert_after (h->control_pending_head, | 581 | GNUNET_CONTAINER_DLL_insert_tail (h->control_pending_head, |
582 | h->control_pending_tail, | 582 | h->control_pending_tail, |
583 | h->control_pending_tail, | 583 | cm); |
584 | cm); | ||
585 | #if DEBUG_CORE | 584 | #if DEBUG_CORE |
586 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 585 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
587 | "Adding SEND REQUEST for peer `%s' to message queue\n", | 586 | "Adding SEND REQUEST for peer `%s' to message queue\n", |
@@ -726,8 +725,14 @@ transmit_message (void *cls, | |||
726 | ret = th->get_message (th->get_message_cls, | 725 | ret = th->get_message (th->get_message_cls, |
727 | size - sizeof (struct SendMessage), | 726 | size - sizeof (struct SendMessage), |
728 | &sm[1]); | 727 | &sm[1]); |
729 | 728 | ||
730 | if (0 == ret) | 729 | #if DEBUG_CORE |
730 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
731 | "Transmitting SEND request to `%s' yielded %u bytes.\n", | ||
732 | GNUNET_i2s (&pr->peer), | ||
733 | ret); | ||
734 | #endif | ||
735 | if (0 == ret) | ||
731 | { | 736 | { |
732 | #if DEBUG_CORE | 737 | #if DEBUG_CORE |
733 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 738 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -852,7 +857,7 @@ main_notify_handler (void *cls, | |||
852 | return; | 857 | return; |
853 | } | 858 | } |
854 | msize = ntohs (msg->size); | 859 | msize = ntohs (msg->size); |
855 | #if DEBUG_CORE | 860 | #if DEBUG_CORE > 2 |
856 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 861 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
857 | "Processing message of type %u and size %u from core service\n", | 862 | "Processing message of type %u and size %u from core service\n", |
858 | ntohs (msg->type), msize); | 863 | ntohs (msg->type), msize); |
@@ -1030,7 +1035,7 @@ main_notify_handler (void *cls, | |||
1030 | reconnect_later (h); | 1035 | reconnect_later (h); |
1031 | return; | 1036 | return; |
1032 | } | 1037 | } |
1033 | #if DEBUG_CORE | 1038 | #if DEBUG_CORE > 1 |
1034 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1039 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1035 | "Received notification about status change by `%s'.\n", | 1040 | "Received notification about status change by `%s'.\n", |
1036 | GNUNET_i2s (&psnm->peer)); | 1041 | GNUNET_i2s (&psnm->peer)); |
@@ -1238,8 +1243,9 @@ main_notify_handler (void *cls, | |||
1238 | } | 1243 | } |
1239 | #if DEBUG_CORE | 1244 | #if DEBUG_CORE |
1240 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1245 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1241 | "Received notification about configuration update for `%s'.\n", | 1246 | "Received notification about configuration update for `%s' with RIM %u.\n", |
1242 | GNUNET_i2s (&cim->peer)); | 1247 | GNUNET_i2s (&cim->peer), |
1248 | (unsigned int) ntohl (cim->rim_id)); | ||
1243 | #endif | 1249 | #endif |
1244 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, | 1250 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, |
1245 | &cim->peer.hashPubKey); | 1251 | &cim->peer.hashPubKey); |
@@ -1793,8 +1799,7 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, | |||
1793 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1799 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1794 | "Queueing REQUEST_CONNECT request\n"); | 1800 | "Queueing REQUEST_CONNECT request\n"); |
1795 | #endif | 1801 | #endif |
1796 | if (h->control_pending_head == cm) | 1802 | trigger_next_request (h, GNUNET_NO); |
1797 | trigger_next_request (h, GNUNET_NO); | ||
1798 | return ret; | 1803 | return ret; |
1799 | } | 1804 | } |
1800 | 1805 | ||
@@ -1811,6 +1816,10 @@ GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle *r | |||
1811 | struct GNUNET_CORE_Handle *h = req->h; | 1816 | struct GNUNET_CORE_Handle *h = req->h; |
1812 | struct ControlMessage *cm = req->cm; | 1817 | struct ControlMessage *cm = req->cm; |
1813 | 1818 | ||
1819 | #if DEBUG_CORE | ||
1820 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1821 | "A CHANGE PREFERENCE request was cancelled!\n"); | ||
1822 | #endif | ||
1814 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, | 1823 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, |
1815 | h->control_pending_tail, | 1824 | h->control_pending_tail, |
1816 | cm); | 1825 | cm); |
@@ -1929,7 +1938,9 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, | |||
1929 | rim->peer = *peer; | 1938 | rim->peer = *peer; |
1930 | #if DEBUG_CORE | 1939 | #if DEBUG_CORE |
1931 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1940 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1932 | "Queueing CHANGE PREFERENCE request\n"); | 1941 | "Queueing CHANGE PREFERENCE request for peer `%s' with RIM %u\n", |
1942 | GNUNET_i2s (peer), | ||
1943 | (unsigned int) pr->rim_id); | ||
1933 | #endif | 1944 | #endif |
1934 | GNUNET_CONTAINER_DLL_insert_tail (h->control_pending_head, | 1945 | GNUNET_CONTAINER_DLL_insert_tail (h->control_pending_head, |
1935 | h->control_pending_tail, | 1946 | h->control_pending_tail, |
@@ -1937,8 +1948,7 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, | |||
1937 | pr->pcic = info; | 1948 | pr->pcic = info; |
1938 | pr->pcic_cls = info_cls; | 1949 | pr->pcic_cls = info_cls; |
1939 | pr->pcic_ptr = irc; /* for free'ing irc */ | 1950 | pr->pcic_ptr = irc; /* for free'ing irc */ |
1940 | if (h->control_pending_head == cm) | 1951 | trigger_next_request (h, GNUNET_NO); |
1941 | trigger_next_request (h, GNUNET_NO); | ||
1942 | return irc; | 1952 | return irc; |
1943 | } | 1953 | } |
1944 | 1954 | ||