From 734207e5ace38782b11b1a54d1448fce2722e312 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 22 Dec 2010 10:49:17 +0000 Subject: ignore self --- src/hostlist/gnunet-daemon-hostlist.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/hostlist/gnunet-daemon-hostlist.c') diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index bd76b17d3..f409dc9a6 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c @@ -125,6 +125,8 @@ struct GNUNET_HOSTLIST_ADV_Message }; +static struct GNUNET_PeerIdentity me; + static void core_init (void *cls, struct GNUNET_CORE_Handle * server, @@ -134,7 +136,7 @@ core_init (void *cls, GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded * publicKey) { - /* Nothing to do here */ + me = *my_identity; } /** @@ -163,6 +165,8 @@ connect_handler (void *cls, GNUNET_PeerIdentity * peer, const struct GNUNET_TRANSPORT_ATS_Information *atsi) { + if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity))) + return; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "A new peer connected, notifying client and server\n"); if ( NULL != client_ch) @@ -184,7 +188,8 @@ disconnect_handler (void *cls, const struct GNUNET_PeerIdentity * peer) { - + if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity))) + return; /* call hostlist client disconnect handler*/ if ( NULL != client_dh) (*client_dh) (cls, peer); -- cgit v1.2.3