From: Christian Grothoff Date: Mon, 17 Oct 2011 20:08:14 +0000 (+0000) Subject: more assertions X-Git-Tag: initial-import-from-subversion-38251~16448 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0417487e26a50ea8a319715ee29c0fd5a617711e;p=oweals%2Fgnunet.git more assertions --- diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 7c724f532..e2fc413ea 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -1127,6 +1127,18 @@ tcp_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, /* check if session is valid */ struct Session *ses = plugin->sessions; + if (0 != memcmp (target, + &session->target, + sizeof (struct GNUNET_PeerIdentity))) + { + GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Got session for `%s', but should be for peer `%s'!\n", + GNUNET_i2s (&session->target), + GNUNET_h2s (&target->hashPubKey)); + return -1; + } + while ((ses != NULL) && (ses != session)) ses = ses->next; if (ses == NULL)