[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated (c9272e7 -> c4815db)
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated (c9272e7 -> c4815db) |
Date: |
Sat, 17 Dec 2016 08:18:18 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a change to branch master
in repository gnunet.
from c9272e7 init 'ch' field
new 88c39e0 need to strdup as this will be freed
new c4815db enable sending only differences for autoconfiguration
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/nat/gnunet-service-nat.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c
index 10bfd07..5ae24c4 100644
--- a/src/nat/gnunet-service-nat.c
+++ b/src/nat/gnunet-service-nat.c
@@ -218,6 +218,11 @@ struct AutoconfigContext
struct GNUNET_CONFIGURATION_Handle *c;
/**
+ * Original configuration (for diffing).
+ */
+ struct GNUNET_CONFIGURATION_Handle *orig;
+
+ /**
* Timeout task to force termination.
*/
struct GNUNET_SCHEDULER_Task *timeout_task;
@@ -1247,13 +1252,17 @@ conclude_autoconfig_request (void *cls)
struct GNUNET_MQ_Envelope *env;
size_t c_size;
char *buf;
-
+ struct GNUNET_CONFIGURATION_Handle *diff;
+
ac->timeout_task = NULL;
terminate_ac_activities (ac);
/* Send back response */
- buf = GNUNET_CONFIGURATION_serialize (ac->c,
+ diff = GNUNET_CONFIGURATION_get_diff (ac->orig,
+ ac->c);
+ buf = GNUNET_CONFIGURATION_serialize (diff,
&c_size);
+ GNUNET_CONFIGURATION_destroy (diff);
env = GNUNET_MQ_msg_extra (arm,
c_size,
GNUNET_MESSAGE_TYPE_NAT_AUTO_CFG_RESULT);
@@ -1268,6 +1277,7 @@ conclude_autoconfig_request (void *cls)
/* clean up */
GNUNET_free (ac->system_type);
+ GNUNET_CONFIGURATION_destroy (ac->orig);
GNUNET_CONFIGURATION_destroy (ac->c);
GNUNET_CONTAINER_DLL_remove (ac_head,
ac_tail,
@@ -1399,11 +1409,13 @@ handle_autoconfig_request (void *cls,
"PEER",
"SYSTEM_TYPE",
&ac->system_type))
- ac->system_type = "UNKNOWN";
+ ac->system_type = GNUNET_strdup ("UNKNOWN");
GNUNET_CONTAINER_DLL_insert (ac_head,
ac_tail,
ac);
+ ac->orig
+ = GNUNET_CONFIGURATION_dup (ac->c);
ac->timeout_task
= GNUNET_SCHEDULER_add_delayed (AUTOCONFIG_TIMEOUT,
&conclude_autoconfig_request,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (c9272e7 -> c4815db),
gnunet <=