[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: add logic to handle monitor
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: add logic to handle monitor start to gnunet-service-tng.c |
Date: |
Wed, 14 Nov 2018 14:42:14 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new da9d61bdb add logic to handle monitor start to gnunet-service-tng.c
da9d61bdb is described below
commit da9d61bdbddb37424a465f63f6b4c691b342363e
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Nov 14 14:42:12 2018 +0100
add logic to handle monitor start to gnunet-service-tng.c
---
src/transport/gnunet-service-tng.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/src/transport/gnunet-service-tng.c
b/src/transport/gnunet-service-tng.c
index 447e9fa5d..d92964654 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -145,7 +145,7 @@ struct GNUNET_STATISTICS_Handle *GST_stats;
const struct GNUNET_CONFIGURATION_Handle *GST_cfg;
/**
- * Configuration handle.
+ * Our public key.
*/
struct GNUNET_PeerIdentity GST_my_identity;
@@ -588,6 +588,31 @@ handle_send_message_ack (void *cls,
/**
+ * Initialize a monitor client.
+ *
+ * @param cls the client
+ * @param start the start message that was sent
+ */
+static void
+handle_monitor_start (void *cls,
+ const struct GNUNET_TRANSPORT_MonitorStart *start)
+{
+ struct TransportClient *tc = cls;
+
+ if (CT_NONE != tc->type)
+ {
+ GNUNET_break (0);
+ GNUNET_SERVICE_client_drop (tc->client);
+ return;
+ }
+ tc->type = CT_MONITOR;
+ tc->details.monitor_peer = start->peer;
+ // FIXME: remember also the one_shot flag!
+ GNUNET_SERVICE_client_continue (tc->client);
+}
+
+
+/**
* Function called when the service shuts down. Unloads our plugins
* and cancels pending validations.
*
@@ -708,6 +733,11 @@ GNUNET_SERVICE_MAIN
GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK,
struct GNUNET_TRANSPORT_SendMessageToAck,
NULL),
+ /* communication with monitors */
+ GNUNET_MQ_hd_fixed_size (monitor_start,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_START,
+ struct GNUNET_TRANSPORT_MonitorStart,
+ NULL),
GNUNET_MQ_handler_end ());
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: add logic to handle monitor start to gnunet-service-tng.c,
gnunet <=