From: Philipp Tölke Date: Sun, 10 Apr 2011 13:19:29 +0000 (+0000) Subject: FIXMEs X-Git-Tag: initial-import-from-subversion-38251~18722 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=19ee99ab594b60ed7f75416f5c4ad59c7cf997d7;p=oweals%2Fgnunet.git FIXMEs --- diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index b5f83f9db..fdb5dddaa 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c @@ -40,6 +40,7 @@ #include "gnunet-service-dns-p.h" #include "gnunet-vpn-packet.h" #include "gnunet-vpn-checksum.h" +#include "gnunet-helper-vpn-api.h" struct GNUNET_VPN_HELPER_Handle *helper_handle; @@ -185,7 +186,12 @@ helper_write(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tsdkctx) { GNUNET_CONTAINER_DLL_remove (answer_proc_head, answer_proc_tail, ans); GNUNET_free(ans); - /* FIXME */ GNUNET_DISK_file_write(helper_handle->fh_to_helper, pkt, pkt_len); + if (GNUNET_DISK_file_write(helper_handle->fh_to_helper, pkt, pkt_len) < 0) + { + cleanup_helper(helper_handle); + GNUNET_SCHEDULER_add_now(start_helper_and_schedule, NULL); + return; + } /* if more packets are available, reschedule */ if (answer_proc_head != NULL) diff --git a/src/vpn/gnunet-helper-vpn-api.c b/src/vpn/gnunet-helper-vpn-api.c index 486dfe042..5736df2b1 100644 --- a/src/vpn/gnunet-helper-vpn-api.c +++ b/src/vpn/gnunet-helper-vpn-api.c @@ -76,8 +76,19 @@ helper_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tsdkctx) return; } - /* FIXME */ GNUNET_SERVER_mst_receive (handle->mst, handle->client, buf, t, - 0, 0); + if (GNUNET_SYSERR == + GNUNET_SERVER_mst_receive (handle->mst, handle->client, buf, t, 0, 0)) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "SYSERR from mst\n"); + stop_helper (handle); + + /* Restart the helper */ + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, + handle->restart_task, handle); + return; + + } GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, handle->fh_from_helper, &helper_read,