aboutsummaryrefslogtreecommitdiffstats
path: root/main/strongswan/1004-vici-support-asynchronous-initiation.patch
blob: 94f82f4b9a9a6f4728f7663a2da9abe88491b0aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From b96502164de6b648a672cc55c53b8d4fdfcd1db7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Mon, 21 Sep 2015 13:42:15 +0300
Subject: [PATCH] vici: support asynchronous initiation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
 src/libcharon/plugins/vici/vici_control.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/libcharon/plugins/vici/vici_control.c b/src/libcharon/plugins/vici/vici_control.c
index 174bae4..5a83cb1 100644
--- a/src/libcharon/plugins/vici/vici_control.c
+++ b/src/libcharon/plugins/vici/vici_control.c
@@ -187,7 +187,7 @@ CALLBACK(initiate, vici_message_t*,
 	host_t *my_host = NULL, *other_host = NULL;
 	char *child, *my_host_str, *other_host_str;
 	u_int timeout;
-	bool limits;
+	bool limits, async;
 	log_info_t log = {
 		.dispatcher = this->dispatcher,
 		.id = id,
@@ -196,6 +196,7 @@ CALLBACK(initiate, vici_message_t*,
 	child = request->get_str(request, NULL, "child");
 	timeout = request->get_int(request, 0, "timeout");
 	limits = request->get_bool(request, FALSE, "init-limits");
+	async = request->get_bool(request, FALSE, "async");
 	log.level = request->get_int(request, 1, "loglevel");
 	my_host_str = request->get_str(request, NULL, "my-host");
 	other_host_str = request->get_str(request, NULL, "other-host");
@@ -224,7 +225,8 @@ CALLBACK(initiate, vici_message_t*,
 	}
 	switch (charon->controller->initiate(charon->controller,
 				peer_cfg, child_cfg, my_host, other_host,
-				(controller_cb_t)log_vici, &log, timeout, limits))
+				async ? NULL : (controller_cb_t)log_vici,
+				&log, timeout, limits))
 	{
 		case SUCCESS:
 			msg = send_reply(this, NULL);
-- 
2.6.3