aboutsummaryrefslogtreecommitdiff
path: root/src/core/gnunet-service-core_kx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/gnunet-service-core_kx.c')
-rw-r--r--src/core/gnunet-service-core_kx.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c
index 6743ce215..a0c343737 100644
--- a/src/core/gnunet-service-core_kx.c
+++ b/src/core/gnunet-service-core_kx.c
@@ -261,7 +261,7 @@ struct GSC_KeyExchangeInfo
261 * Message queue for sending messages to @a peer. 261 * Message queue for sending messages to @a peer.
262 */ 262 */
263 struct GNUNET_MQ_Handle *mq; 263 struct GNUNET_MQ_Handle *mq;
264 264
265 /** 265 /**
266 * PING message we transmit to the other peer. 266 * PING message we transmit to the other peer.
267 */ 267 */
@@ -777,7 +777,7 @@ handle_transport_notify_disconnect (void *cls,
777 void *handler_cls) 777 void *handler_cls)
778{ 778{
779 struct GSC_KeyExchangeInfo *kx = handler_cls; 779 struct GSC_KeyExchangeInfo *kx = handler_cls;
780 780
781 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 781 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
782 "Peer `%s' disconnected from us.\n", 782 "Peer `%s' disconnected from us.\n",
783 GNUNET_i2s (peer)); 783 GNUNET_i2s (peer));
@@ -814,7 +814,7 @@ static void
814send_ping (struct GSC_KeyExchangeInfo *kx) 814send_ping (struct GSC_KeyExchangeInfo *kx)
815{ 815{
816 struct GNUNET_MQ_Envelope *env; 816 struct GNUNET_MQ_Envelope *env;
817 817
818 GNUNET_STATISTICS_update (GSC_stats, 818 GNUNET_STATISTICS_update (GSC_stats,
819 gettext_noop ("# PING messages transmitted"), 819 gettext_noop ("# PING messages transmitted"),
820 1, 820 1,
@@ -1332,7 +1332,7 @@ static void
1332send_key (struct GSC_KeyExchangeInfo *kx) 1332send_key (struct GSC_KeyExchangeInfo *kx)
1333{ 1333{
1334 struct GNUNET_MQ_Envelope *env; 1334 struct GNUNET_MQ_Envelope *env;
1335 1335
1336 GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status); 1336 GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status);
1337 if (NULL != kx->retry_set_key_task) 1337 if (NULL != kx->retry_set_key_task)
1338 { 1338 {
@@ -1520,7 +1520,7 @@ handle_encrypted (void *cls,
1520 sizeof (struct GNUNET_HashCode))) 1520 sizeof (struct GNUNET_HashCode)))
1521 { 1521 {
1522 /* checksum failed */ 1522 /* checksum failed */
1523 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1523 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1524 "Failed checksum validation for a message from `%s'\n", 1524 "Failed checksum validation for a message from `%s'\n",
1525 GNUNET_i2s (kx->peer)); 1525 GNUNET_i2s (kx->peer));
1526 return; 1526 return;
@@ -1536,7 +1536,10 @@ handle_encrypted (void *cls,
1536 &m->sequence_number, 1536 &m->sequence_number,
1537 &buf[ENCRYPTED_HEADER_SIZE], 1537 &buf[ENCRYPTED_HEADER_SIZE],
1538 size - ENCRYPTED_HEADER_SIZE)) 1538 size - ENCRYPTED_HEADER_SIZE))
1539 {
1540 GNUNET_break_op (0);
1539 return; 1541 return;
1542 }
1540 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1543 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1541 "Decrypted %u bytes from %s\n", 1544 "Decrypted %u bytes from %s\n",
1542 (unsigned int) (size - ENCRYPTED_HEADER_SIZE), 1545 (unsigned int) (size - ENCRYPTED_HEADER_SIZE),
@@ -1642,7 +1645,7 @@ handle_transport_notify_excess_bw (void *cls,
1642 const struct GNUNET_PeerIdentity *pid, 1645 const struct GNUNET_PeerIdentity *pid,
1643 void *connect_cls) 1646 void *connect_cls)
1644{ 1647{
1645 struct GSC_KeyExchangeInfo *kx = connect_cls; 1648 struct GSC_KeyExchangeInfo *kx = connect_cls;
1646 1649
1647 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1650 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1648 "Peer %s has excess bandwidth available\n", 1651 "Peer %s has excess bandwidth available\n",
@@ -1668,6 +1671,10 @@ deliver_message (void *cls,
1668{ 1671{
1669 struct DeliverMessageContext *dmc = client; 1672 struct DeliverMessageContext *dmc = client;
1670 1673
1674 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1675 "Decrypted message of type %d from %s\n",
1676 ntohs (m->type),
1677 GNUNET_i2s (dmc->peer));
1671 if (GNUNET_CORE_KX_STATE_UP != dmc->kx->status) 1678 if (GNUNET_CORE_KX_STATE_UP != dmc->kx->status)
1672 { 1679 {
1673 GNUNET_STATISTICS_update (GSC_stats, 1680 GNUNET_STATISTICS_update (GSC_stats,
@@ -1824,7 +1831,7 @@ GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
1824 NULL); 1831 NULL);
1825 mst = GNUNET_SERVER_mst_create (&deliver_message, 1832 mst = GNUNET_SERVER_mst_create (&deliver_message,
1826 NULL); 1833 NULL);
1827 transport 1834 transport
1828 = GNUNET_TRANSPORT_core_connect (GSC_cfg, 1835 = GNUNET_TRANSPORT_core_connect (GSC_cfg,
1829 &GSC_my_identity, 1836 &GSC_my_identity,
1830 handlers, 1837 handlers,
@@ -1927,7 +1934,7 @@ GSC_KX_handle_client_monitor_peers (struct GNUNET_MQ_Handle *mq)
1927 { 1934 {
1928 struct GNUNET_MQ_Envelope *env; 1935 struct GNUNET_MQ_Envelope *env;
1929 struct MonitorNotifyMessage *msg; 1936 struct MonitorNotifyMessage *msg;
1930 1937
1931 env = GNUNET_MQ_msg (msg, 1938 env = GNUNET_MQ_msg (msg,
1932 GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY); 1939 GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY);
1933 msg->state = htonl ((uint32_t) kx->status); 1940 msg->state = htonl ((uint32_t) kx->status);