diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-04 21:01:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-04 21:01:22 +0000 |
commit | 0e4c7cdccfc4105f9c6e529cfa0e3722104b0ddf (patch) | |
tree | ac53b9088e75b7041e14e3455698a75da085b3d7 /src/hostlist | |
parent | b6d09b511fbd61d3b36fde4c28624bed321bf4a1 (diff) | |
download | gnunet-0e4c7cdccfc4105f9c6e529cfa0e3722104b0ddf.tar.gz gnunet-0e4c7cdccfc4105f9c6e529cfa0e3722104b0ddf.zip |
-misc bugfixes, travel hacking
Diffstat (limited to 'src/hostlist')
-rw-r--r-- | src/hostlist/gnunet-daemon-hostlist.c | 2 | ||||
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_peer1.conf | 1 | ||||
-rw-r--r-- | src/hostlist/test_gnunet_daemon_hostlist_reconnect.c | 21 | ||||
-rw-r--r-- | src/hostlist/test_hostlist_defaults.conf | 2 |
4 files changed, 2 insertions, 24 deletions
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index 6637f37ce..255f0d544 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c | |||
@@ -343,7 +343,7 @@ main (int argc, char *const *argv) | |||
343 | GNUNET_PROGRAM_run (argc, argv, "hostlist", | 343 | GNUNET_PROGRAM_run (argc, argv, "hostlist", |
344 | _("GNUnet hostlist server and client"), options, | 344 | _("GNUnet hostlist server and client"), options, |
345 | &run, NULL)) ? 0 : 1; | 345 | &run, NULL)) ? 0 : 1; |
346 | 346 | GNUNET_free ((void*) argv); | |
347 | return ret; | 347 | return ret; |
348 | } | 348 | } |
349 | 349 | ||
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf index c880190a1..0a345f6bf 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf +++ b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf | |||
@@ -25,7 +25,6 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | |||
25 | [transport] | 25 | [transport] |
26 | PORT = 12965 | 26 | PORT = 12965 |
27 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | 27 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock |
28 | DEBUG = NO | ||
29 | 28 | ||
30 | [core] | 29 | [core] |
31 | PORT = 12970 | 30 | PORT = 12970 |
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 63baced46..74ef37f16 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c | |||
@@ -28,11 +28,6 @@ | |||
28 | #include "gnunet_arm_service.h" | 28 | #include "gnunet_arm_service.h" |
29 | #include "gnunet_transport_service.h" | 29 | #include "gnunet_transport_service.h" |
30 | 30 | ||
31 | #define VERBOSE GNUNET_NO | ||
32 | |||
33 | #define START_ARM GNUNET_YES | ||
34 | |||
35 | |||
36 | /** | 31 | /** |
37 | * How long until we give up on transmitting the message? | 32 | * How long until we give up on transmitting the message? |
38 | */ | 33 | */ |
@@ -48,9 +43,7 @@ struct PeerContext | |||
48 | struct GNUNET_TRANSPORT_Handle *th; | 43 | struct GNUNET_TRANSPORT_Handle *th; |
49 | struct GNUNET_MessageHeader *hello; | 44 | struct GNUNET_MessageHeader *hello; |
50 | struct GNUNET_TRANSPORT_GetHelloHandle *ghh; | 45 | struct GNUNET_TRANSPORT_GetHelloHandle *ghh; |
51 | #if START_ARM | ||
52 | struct GNUNET_OS_Process *arm_proc; | 46 | struct GNUNET_OS_Process *arm_proc; |
53 | #endif | ||
54 | }; | 47 | }; |
55 | 48 | ||
56 | static struct PeerContext p1; | 49 | static struct PeerContext p1; |
@@ -112,9 +105,6 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
112 | { | 105 | { |
113 | if (peer == NULL) | 106 | if (peer == NULL) |
114 | return; | 107 | return; |
115 | #if VERBOSE | ||
116 | FPRINTF (stderr, "Peer %s connected\n", GNUNET_i2s (peer)); | ||
117 | #endif | ||
118 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n"); | 108 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n"); |
119 | ok = 0; | 109 | ok = 0; |
120 | if (timeout_task != GNUNET_SCHEDULER_NO_TASK) | 110 | if (timeout_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -145,12 +135,10 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
145 | 135 | ||
146 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 136 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
147 | p->cfg = GNUNET_CONFIGURATION_create (); | 137 | p->cfg = GNUNET_CONFIGURATION_create (); |
148 | #if START_ARM | ||
149 | p->arm_proc = | 138 | p->arm_proc = |
150 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 139 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, |
151 | "gnunet-service-arm", | 140 | "gnunet-service-arm", |
152 | "-c", cfgname, NULL); | 141 | "-c", cfgname, NULL); |
153 | #endif | ||
154 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 142 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
155 | p->th = | 143 | p->th = |
156 | GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL); | 144 | GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL); |
@@ -165,7 +153,6 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
165 | { | 153 | { |
166 | struct PeerContext *p = cls; | 154 | struct PeerContext *p = cls; |
167 | 155 | ||
168 | #if START_ARM | ||
169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n"); | 156 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n"); |
170 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) | 157 | if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) |
171 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 158 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
@@ -175,7 +162,6 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
175 | GNUNET_OS_process_get_pid (p->arm_proc)); | 162 | GNUNET_OS_process_get_pid (p->arm_proc)); |
176 | GNUNET_OS_process_destroy (p->arm_proc); | 163 | GNUNET_OS_process_destroy (p->arm_proc); |
177 | p->arm_proc = NULL; | 164 | p->arm_proc = NULL; |
178 | #endif | ||
179 | GNUNET_CONFIGURATION_destroy (p->cfg); | 165 | GNUNET_CONFIGURATION_destroy (p->cfg); |
180 | } | 166 | } |
181 | 167 | ||
@@ -218,9 +204,6 @@ check () | |||
218 | { | 204 | { |
219 | char *const argv[] = { "test-gnunet-daemon-hostlist", | 205 | char *const argv[] = { "test-gnunet-daemon-hostlist", |
220 | "-c", "test_gnunet_daemon_hostlist_data.conf", | 206 | "-c", "test_gnunet_daemon_hostlist_data.conf", |
221 | #if VERBOSE | ||
222 | "-L", "DEBUG", | ||
223 | #endif | ||
224 | NULL | 207 | NULL |
225 | }; | 208 | }; |
226 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 209 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
@@ -244,11 +227,7 @@ main (int argc, char *argv[]) | |||
244 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); | 227 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); |
245 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); | 228 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); |
246 | GNUNET_log_setup ("test-gnunet-daemon-hostlist", | 229 | GNUNET_log_setup ("test-gnunet-daemon-hostlist", |
247 | #if VERBOSE | ||
248 | "DEBUG", | ||
249 | #else | ||
250 | "WARNING", | 230 | "WARNING", |
251 | #endif | ||
252 | NULL); | 231 | NULL); |
253 | ret = check (); | 232 | ret = check (); |
254 | if (ret == 0) | 233 | if (ret == 0) |
diff --git a/src/hostlist/test_hostlist_defaults.conf b/src/hostlist/test_hostlist_defaults.conf index d7383005c..fe3756a1e 100644 --- a/src/hostlist/test_hostlist_defaults.conf +++ b/src/hostlist/test_hostlist_defaults.conf | |||
@@ -67,4 +67,4 @@ AUTOSTART = NO | |||
67 | AUTOSTART = NO | 67 | AUTOSTART = NO |
68 | 68 | ||
69 | [nat] | 69 | [nat] |
70 | RETURN_LOCAL_ADDRESSES = YES \ No newline at end of file | 70 | RETURN_LOCAL_ADDRESSES = YES |