aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2011-06-19 12:34:14 +0000
committerPhilipp Tölke <toelke@in.tum.de>2011-06-19 12:34:14 +0000
commit07870c9466ab919dc65cfb93e80254ea207999bd (patch)
treef0f0883f5db021e68465c210955db3e4cc6ed203 /src/vpn
parent135ec26aa7c37786e2dfa1d6dc99f9ea407cdb30 (diff)
try to fix the helper-startup and so on
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-daemon-exit.c2
-rw-r--r--src/vpn/gnunet-daemon-vpn-helper.c3
-rw-r--r--src/vpn/gnunet-helper-vpn-api.c6
3 files changed, 9 insertions, 2 deletions
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c
index 08b414d5c2..d12c59d207 100644
--- a/src/vpn/gnunet-daemon-exit.c
+++ b/src/vpn/gnunet-daemon-exit.c
@@ -36,6 +36,8 @@
#include "gnunet-helper-vpn-api.h"
#include "gnunet-vpn-checksum.h"
+GNUNET_SCHEDULER_TaskIdentifier shs_task;
+
/**
* The handle to the configuration used throughout the process
*/
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c
index 9a1ddd8cc1..e5fb59c003 100644
--- a/src/vpn/gnunet-daemon-vpn-helper.c
+++ b/src/vpn/gnunet-daemon-vpn-helper.c
@@ -126,6 +126,8 @@ start_helper_and_schedule(void *cls,
restart_hijack = 1;
if (NULL != dns_connection)
GNUNET_CLIENT_notify_transmit_ready(dns_connection, sizeof(struct GNUNET_MessageHeader), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL);
+
+ GNUNET_SCHEDULER_add_write_file (GNUNET_TIME_UNIT_FOREVER_REL, helper_handle->fh_to_helper, &helper_write, NULL);
}
/*}}}*/
@@ -410,5 +412,6 @@ void write_to_helper(void* buf, size_t len)
void schedule_helper_write(struct GNUNET_TIME_Relative time, void* cls)
{
+ if (GNUNET_SCHEDULER_NO_TASK == shs_task) return;
GNUNET_SCHEDULER_add_write_file (time, helper_handle->fh_to_helper, &helper_write, cls);
}
diff --git a/src/vpn/gnunet-helper-vpn-api.c b/src/vpn/gnunet-helper-vpn-api.c
index 195a79217e..1022d54e9a 100644
--- a/src/vpn/gnunet-helper-vpn-api.c
+++ b/src/vpn/gnunet-helper-vpn-api.c
@@ -48,6 +48,8 @@ stop_helper (struct GNUNET_VPN_HELPER_Handle *handle)
GNUNET_SERVER_mst_destroy(handle->mst);
}
+extern GNUNET_SCHEDULER_TaskIdentifier shs_task;
+
/**
* Read from the helper-process
*/
@@ -71,7 +73,7 @@ helper_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tsdkctx)
stop_helper (handle);
/* Restart the helper */
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+ shs_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
handle->restart_task, handle);
return;
}
@@ -84,7 +86,7 @@ helper_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tsdkctx)
stop_helper (handle);
/* Restart the helper */
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+ shs_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
handle->restart_task, handle);
return;