From 6eb89731fdfa66481e4f0b1fc3fca6139d99039f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 26 Feb 2019 09:39:07 +0100 Subject: [PATCH] avoid bogus reconnect message --- src/core/core_api_monitor_peers.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core/core_api_monitor_peers.c b/src/core/core_api_monitor_peers.c index 8820b44d1..0ebb94d7b 100644 --- a/src/core/core_api_monitor_peers.c +++ b/src/core/core_api_monitor_peers.c @@ -11,7 +11,7 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -135,10 +135,11 @@ reconnect (struct GNUNET_CORE_MonitorHandle *mh) if (NULL == mh->mq) return; /* notify callback about reconnect */ - mh->peer_cb (mh->peer_cb_cls, - NULL, - GNUNET_CORE_KX_CORE_DISCONNECT, - GNUNET_TIME_UNIT_FOREVER_ABS); + if (NULL != mh->peer_cb) + mh->peer_cb (mh->peer_cb_cls, + NULL, + GNUNET_CORE_KX_CORE_DISCONNECT, + GNUNET_TIME_UNIT_FOREVER_ABS); env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS); GNUNET_MQ_send (mh->mq, @@ -172,9 +173,9 @@ GNUNET_CORE_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_assert (NULL != peer_cb); mh = GNUNET_new (struct GNUNET_CORE_MonitorHandle); mh->cfg = cfg; + reconnect (mh); mh->peer_cb = peer_cb; mh->peer_cb_cls = peer_cb_cls; - reconnect (mh); if (NULL == mh->mq) { GNUNET_free (mh); -- 2.25.1