diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-tng.c | 10 | ||||
-rw-r--r-- | src/util/gnunet-timeout.c | 33 |
2 files changed, 21 insertions, 22 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index f009a491b..20285f94a 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -44,6 +44,16 @@ | |||
44 | * - increment incoming_fc_window_size_used_kb when CORE is done | 44 | * - increment incoming_fc_window_size_used_kb when CORE is done |
45 | * with incoming packets! | 45 | * with incoming packets! |
46 | * | 46 | * |
47 | * for DV) | ||
48 | * - send challenges via DV (when DVH is confirmed *and* we care about | ||
49 | * the target to get window size, or when DVH is unconfirmed (passive | ||
50 | * learning!) to confirm it!) | ||
51 | * - handle challenge responses in this case (note: validity period of addresses | ||
52 | * will be zero!) | ||
53 | * - if available, try to use DV paths when trying to establish | ||
54 | * virtual link for a `struct IncomingRequest`. (i.e. if DVH is | ||
55 | * unconfirmed, incoming requests also trigger challenge-via-DV!) | ||
56 | * | ||
47 | * - review retransmission logic, right now there is no smartness there! | 57 | * - review retransmission logic, right now there is no smartness there! |
48 | * => congestion control, etc [PERFORMANCE-BASICS] | 58 | * => congestion control, etc [PERFORMANCE-BASICS] |
49 | * | 59 | * |
diff --git a/src/util/gnunet-timeout.c b/src/util/gnunet-timeout.c index 18721ba03..d71b66af4 100644 --- a/src/util/gnunet-timeout.c +++ b/src/util/gnunet-timeout.c | |||
@@ -41,42 +41,33 @@ sigchld_handler (int val) | |||
41 | int ret = 0; | 41 | int ret = 0; |
42 | 42 | ||
43 | (void) val; | 43 | (void) val; |
44 | waitpid (child, | 44 | waitpid (child, &status, 0); |
45 | &status, | ||
46 | 0); | ||
47 | if (WIFEXITED (status) != 0) | 45 | if (WIFEXITED (status) != 0) |
48 | { | 46 | { |
49 | ret = WEXITSTATUS (status); | 47 | ret = WEXITSTATUS (status); |
50 | fprintf (stderr, | 48 | fprintf (stderr, "Process exited with result %u\n", ret); |
51 | "Process exited with result %u\n", | 49 | _exit (ret); /* return same status code */ |
52 | ret); | ||
53 | exit (ret); /* return same status code */ | ||
54 | } | 50 | } |
55 | if (WIFSIGNALED (status) != 0) | 51 | if (WIFSIGNALED (status) != 0) |
56 | { | 52 | { |
57 | ret = WTERMSIG (status); | 53 | ret = WTERMSIG (status); |
58 | fprintf (stderr, | 54 | fprintf (stderr, "Process received signal %u\n", ret); |
59 | "Process received signal %u\n", | 55 | kill (getpid (), ret); /* kill self with the same signal */ |
60 | ret); | ||
61 | kill (getpid (), | ||
62 | ret); /* kill self with the same signal */ | ||
63 | } | 56 | } |
64 | exit (-1); | 57 | _exit (-1); |
65 | } | 58 | } |
66 | 59 | ||
67 | 60 | ||
68 | static void | 61 | static void |
69 | sigint_handler (int val) | 62 | sigint_handler (int val) |
70 | { | 63 | { |
71 | kill (0, | 64 | kill (0, val); |
72 | val); | 65 | _exit (val); |
73 | exit (val); | ||
74 | } | 66 | } |
75 | 67 | ||
76 | 68 | ||
77 | int | 69 | int |
78 | main (int argc, | 70 | main (int argc, char *argv[]) |
79 | char *argv[]) | ||
80 | { | 71 | { |
81 | int timeout = 0; | 72 | int timeout = 0; |
82 | pid_t gpid = 0; | 73 | pid_t gpid = 0; |
@@ -111,8 +102,7 @@ main (int argc, | |||
111 | //setpgrp (0, pid_t gpid); | 102 | //setpgrp (0, pid_t gpid); |
112 | if (-1 != gpid) | 103 | if (-1 != gpid) |
113 | setpgid (0, gpid); | 104 | setpgid (0, gpid); |
114 | execvp (argv[2], | 105 | execvp (argv[2], &argv[2]); |
115 | &argv[2]); | ||
116 | exit (-1); | 106 | exit (-1); |
117 | } | 107 | } |
118 | if (child > 0) | 108 | if (child > 0) |
@@ -120,8 +110,7 @@ main (int argc, | |||
120 | sleep (timeout); | 110 | sleep (timeout); |
121 | printf ("Child processes were killed after timeout of %u seconds\n", | 111 | printf ("Child processes were killed after timeout of %u seconds\n", |
122 | timeout); | 112 | timeout); |
123 | kill (0, | 113 | kill (0, SIGTERM); |
124 | SIGTERM); | ||
125 | exit (3); | 114 | exit (3); |
126 | } | 115 | } |
127 | exit (-1); | 116 | exit (-1); |