aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2010-07-20 19:53:52 +0000
committerPhilipp Tölke <toelke@in.tum.de>2010-07-20 19:53:52 +0000
commit9315fa7ca773e561efaba508f1868c9412bb9884 (patch)
tree224b770378f5abe9b555712ccacd1aa379f9dd61 /src/vpn
parent620eed92bd84969ce0f1f25490473158974daa1f (diff)
downloadgnunet-9315fa7ca773e561efaba508f1868c9412bb9884.tar.gz
gnunet-9315fa7ca773e561efaba508f1868c9412bb9884.zip
restart the helper when something goes wrong
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-daemon-vpn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index e3ae2a16e..b003d7b53 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -92,8 +92,9 @@ static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* ts
92 92
93 while (r < sizeof(struct suid_packet_header)) { 93 while (r < sizeof(struct suid_packet_header)) {
94 int t = GNUNET_DISK_file_read(mycls->fh_from_helper, &hdr, sizeof(struct suid_packet_header)); 94 int t = GNUNET_DISK_file_read(mycls->fh_from_helper, &hdr, sizeof(struct suid_packet_header));
95 if (t< 0) { 95 if (t<=0) {
96 fprintf(stderr, "Read error for header: %m\n"); 96 fprintf(stderr, "Read error for header: %m\n");
97 GNUNET_SCHEDULER_add_now(mycls->sched, restart_helper, cls);
97 return; 98 return;
98 } 99 }
99 r += t; 100 r += t;
@@ -108,8 +109,9 @@ static void helper_read(void* cls, const struct GNUNET_SCHEDULER_TaskContext* ts
108 109
109 while (r < ntohl(pkt->hdr.size)) { 110 while (r < ntohl(pkt->hdr.size)) {
110 int t = GNUNET_DISK_file_read(mycls->fh_from_helper, (unsigned char*)pkt + r, ntohl(pkt->hdr.size) - r); 111 int t = GNUNET_DISK_file_read(mycls->fh_from_helper, (unsigned char*)pkt + r, ntohl(pkt->hdr.size) - r);
111 if (t< 0) { 112 if (t<=0) {
112 fprintf(stderr, "Read error for data: %m\n"); 113 fprintf(stderr, "Read error for data: %m\n");
114 GNUNET_SCHEDULER_add_now(mycls->sched, restart_helper, cls);
113 return; 115 return;
114 } 116 }
115 r += t; 117 r += t;