[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37663 - gnunet/src/testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37663 - gnunet/src/testbed |
Date: |
Thu, 4 Aug 2016 16:46:16 +0200 |
Author: grothoff
Date: 2016-08-04 16:46:16 +0200 (Thu, 04 Aug 2016)
New Revision: 37663
Modified:
gnunet/src/testbed/gnunet-service-testbed_connectionpool.c
gnunet/src/testbed/gnunet-service-testbed_oc.c
Log:
-migrate testbed to new MQ API
Modified: gnunet/src/testbed/gnunet-service-testbed_connectionpool.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_connectionpool.c 2016-08-04
13:26:21 UTC (rev 37662)
+++ gnunet/src/testbed/gnunet-service-testbed_connectionpool.c 2016-08-04
14:46:16 UTC (rev 37663)
@@ -605,24 +605,30 @@
*
* @param cls the #PooledConnection object
* @param peer peer identity this notification is about
+ * @param mq message queue for talking to @a peer
+ * @return peer
*/
-static void
+static void *
core_peer_connect_cb (void *cls,
- const struct GNUNET_PeerIdentity *peer)
+ const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_MQ_Handle *mq)
{
struct PooledConnection *entry = cls;
- peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_CORE);
+ peer_connect_notify_cb (entry,
+ peer,
+ GST_CONNECTIONPOOL_SERVICE_CORE);
+ return (void *) peer;
}
/**
- * Function called after #GNUNET_CORE_connect() has succeeded (or failed
+ * Function called after #GNUNET_CORE_connecT() has succeeded (or failed
* for good). Note that the private key of the peer is intentionally
* not exposed here; if you need it, your process should try to read
* the private key file directly (which should work if you are
* authorized...). Implementations of this function must not call
- * #GNUNET_CORE_disconnect() (other than by scheduling a new task to
+ * #GNUNET_CORE_disconnecT() (other than by scheduling a new task to
* do this later).
*
* @param cls the #PooledConnection object
@@ -664,22 +670,17 @@
opstart_get_handle_core (void *cls)
{
struct PooledConnection *entry = cls;
- const struct GNUNET_CORE_MessageHandler no_handlers[] = {
- {NULL, 0, 0}
- };
GNUNET_assert (NULL != entry);
- LOG_DEBUG ("Opening a CORE connection to peer %u\n", entry->index);
- entry->handle_core =
- GNUNET_CORE_connect (entry->cfg, entry, /* closure */
+ LOG_DEBUG ("Opening a CORE connection to peer %u\n",
+ entry->index);
+ entry->handle_core
+ = GNUNET_CORE_connecT (entry->cfg,
+ entry, /* closure */
&core_startup_cb, /* core startup notify */
&core_peer_connect_cb, /* peer connect notify */
NULL, /* peer disconnect notify */
- NULL, /* inbound notify */
- GNUNET_NO, /* inbound header only? */
- NULL, /* outbound notify */
- GNUNET_NO, /* outbound header only? */
- no_handlers);
+ NULL);
}
@@ -696,7 +697,7 @@
if (NULL == entry->handle_core)
return;
- GNUNET_CORE_disconnect (entry->handle_core);
+ GNUNET_CORE_disconnecT (entry->handle_core);
entry->handle_core = NULL;
GNUNET_free_non_null (entry->peer_identity);
entry->peer_identity = NULL;
Modified: gnunet/src/testbed/gnunet-service-testbed_oc.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_oc.c 2016-08-04 13:26:21 UTC
(rev 37662)
+++ gnunet/src/testbed/gnunet-service-testbed_oc.c 2016-08-04 14:46:16 UTC
(rev 37663)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- Copyright (C) 2008--2015 GNUnet e.V.
+ Copyright (C) 2008--2016 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -1133,9 +1133,9 @@
return;
}
occ->emsg = NULL;
- if (GNUNET_YES ==
- GNUNET_CORE_is_peer_connected_sync (ch,
- &occ->other_peer_identity))
+ if (NULL !=
+ GNUNET_CORE_get_mq (ch,
+ &occ->other_peer_identity))
{
LOG_DEBUG ("0x%llx: Target peer already connected\n",
occ->op_id);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37663 - gnunet/src/testbed,
gnunet <=