aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-02-26 09:39:07 +0100
committerChristian Grothoff <christian@grothoff.org>2019-02-26 09:39:51 +0100
commit6eb89731fdfa66481e4f0b1fc3fca6139d99039f (patch)
treed0cbec31884de1d151f4deb73105f792105aebeb /src/core
parentfaf2ff1ed44cedbfa163c90e7860ec3ce9b6031f (diff)
downloadgnunet-6eb89731fdfa66481e4f0b1fc3fca6139d99039f.tar.gz
gnunet-6eb89731fdfa66481e4f0b1fc3fca6139d99039f.zip
avoid bogus reconnect message
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core_api_monitor_peers.c13
1 files 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 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -135,10 +135,11 @@ reconnect (struct GNUNET_CORE_MonitorHandle *mh)
135 if (NULL == mh->mq) 135 if (NULL == mh->mq)
136 return; 136 return;
137 /* notify callback about reconnect */ 137 /* notify callback about reconnect */
138 mh->peer_cb (mh->peer_cb_cls, 138 if (NULL != mh->peer_cb)
139 NULL, 139 mh->peer_cb (mh->peer_cb_cls,
140 GNUNET_CORE_KX_CORE_DISCONNECT, 140 NULL,
141 GNUNET_TIME_UNIT_FOREVER_ABS); 141 GNUNET_CORE_KX_CORE_DISCONNECT,
142 GNUNET_TIME_UNIT_FOREVER_ABS);
142 env = GNUNET_MQ_msg (msg, 143 env = GNUNET_MQ_msg (msg,
143 GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS); 144 GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS);
144 GNUNET_MQ_send (mh->mq, 145 GNUNET_MQ_send (mh->mq,
@@ -172,9 +173,9 @@ GNUNET_CORE_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
172 GNUNET_assert (NULL != peer_cb); 173 GNUNET_assert (NULL != peer_cb);
173 mh = GNUNET_new (struct GNUNET_CORE_MonitorHandle); 174 mh = GNUNET_new (struct GNUNET_CORE_MonitorHandle);
174 mh->cfg = cfg; 175 mh->cfg = cfg;
176 reconnect (mh);
175 mh->peer_cb = peer_cb; 177 mh->peer_cb = peer_cb;
176 mh->peer_cb_cls = peer_cb_cls; 178 mh->peer_cb_cls = peer_cb_cls;
177 reconnect (mh);
178 if (NULL == mh->mq) 179 if (NULL == mh->mq)
179 { 180 {
180 GNUNET_free (mh); 181 GNUNET_free (mh);