aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-01-09 18:04:35 +0000
committerBart Polot <bart@net.in.tum.de>2015-01-09 18:04:35 +0000
commit212668b5d40c7f295eefb9da08192c2ae8d04c19 (patch)
treeb6b6c2a076724a08520b215153994e2bf077adad /src
parent19cf0bdc1761d2dce840f931b7f0ae8ea41a3c5a (diff)
downloadgnunet-212668b5d40c7f295eefb9da08192c2ae8d04c19.tar.gz
gnunet-212668b5d40c7f295eefb9da08192c2ae8d04c19.zip
- test connection_create size, add size to log
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 548eeb9b3..7a9ae37d2 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -1635,11 +1635,14 @@ log_message (const struct GNUNET_MessageHeader *message,
1635 const struct GNUNET_PeerIdentity *peer, 1635 const struct GNUNET_PeerIdentity *peer,
1636 const struct GNUNET_CADET_Hash *hash) 1636 const struct GNUNET_CADET_Hash *hash)
1637{ 1637{
1638 uint16_t size;
1639
1640 size = ntohs (message->size);
1638 LOG (GNUNET_ERROR_TYPE_INFO, "\n"); 1641 LOG (GNUNET_ERROR_TYPE_INFO, "\n");
1639 LOG (GNUNET_ERROR_TYPE_INFO, "\n"); 1642 LOG (GNUNET_ERROR_TYPE_INFO, "\n");
1640 LOG (GNUNET_ERROR_TYPE_INFO, "<-- %s on connection %s from %s\n", 1643 LOG (GNUNET_ERROR_TYPE_INFO, "<-- %s on connection %s from %s, %6u bytes\n",
1641 GC_m2s (ntohs (message->type)), GNUNET_h2s (GC_h2hc (hash)), 1644 GC_m2s (ntohs (message->type)), GNUNET_h2s (GC_h2hc (hash)),
1642 GNUNET_i2s (peer)); 1645 GNUNET_i2s (peer), (unsigned int) size);
1643} 1646}
1644 1647
1645/******************************************************************************/ 1648/******************************************************************************/
@@ -1685,6 +1688,11 @@ GCC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer,
1685 GNUNET_break_op (0); 1688 GNUNET_break_op (0);
1686 return GNUNET_OK; 1689 return GNUNET_OK;
1687 } 1690 }
1691 if (0 != size % sizeof (struct GNUNET_PeerIdentity))
1692 {
1693 GNUNET_break_op (0);
1694 return GNUNET_OK;
1695 }
1688 size /= sizeof (struct GNUNET_PeerIdentity); 1696 size /= sizeof (struct GNUNET_PeerIdentity);
1689 if (1 > size) 1697 if (1 > size)
1690 { 1698 {