diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-25 15:28:08 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-25 15:28:08 +0000 |
commit | 30c5c323f28ade8a1e7c6c593778793e44accb3a (patch) | |
tree | 845955ec895d221338b44f0cadce7932932e78cc /src/testbed/gnunet-helper-testbed.c | |
parent | 43d558efd13a3245e65efd0acdc9c4ba59cd2bee (diff) | |
download | gnunet-30c5c323f28ade8a1e7c6c593778793e44accb3a.tar.gz gnunet-30c5c323f28ade8a1e7c6c593778793e44accb3a.zip |
- indent
Diffstat (limited to 'src/testbed/gnunet-helper-testbed.c')
-rw-r--r-- | src/testbed/gnunet-helper-testbed.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 8f94d5ce5..7d0bf873d 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c | |||
@@ -252,7 +252,7 @@ tokenizer_cb (void *cls, void *client, | |||
252 | uint16_t trusted_ip_size; | 252 | uint16_t trusted_ip_size; |
253 | uint16_t hostname_size; | 253 | uint16_t hostname_size; |
254 | uint16_t msize; | 254 | uint16_t msize; |
255 | 255 | ||
256 | msize = ntohs (message->size); | 256 | msize = ntohs (message->size); |
257 | if ((sizeof (struct GNUNET_TESTBED_HelperInit) >= msize) || | 257 | if ((sizeof (struct GNUNET_TESTBED_HelperInit) >= msize) || |
258 | (GNUNET_MESSAGE_TYPE_TESTBED_HELPER_INIT != ntohs (message->type))) | 258 | (GNUNET_MESSAGE_TYPE_TESTBED_HELPER_INIT != ntohs (message->type))) |
@@ -265,8 +265,7 @@ tokenizer_cb (void *cls, void *client, | |||
265 | trusted_ip = (char *) &msg[1]; | 265 | trusted_ip = (char *) &msg[1]; |
266 | if ('\0' != trusted_ip[trusted_ip_size]) | 266 | if ('\0' != trusted_ip[trusted_ip_size]) |
267 | { | 267 | { |
268 | LOG (GNUNET_ERROR_TYPE_WARNING, | 268 | LOG (GNUNET_ERROR_TYPE_WARNING, "Trusted IP cannot be empty -- exiting\n"); |
269 | "Trusted IP cannot be empty -- exiting\n"); | ||
270 | goto error; | 269 | goto error; |
271 | } | 270 | } |
272 | hostname_size = ntohs (msg->hostname_size); | 271 | hostname_size = ntohs (msg->hostname_size); |
@@ -276,7 +275,7 @@ tokenizer_cb (void *cls, void *client, | |||
276 | GNUNET_break (0); | 275 | GNUNET_break (0); |
277 | LOG (GNUNET_ERROR_TYPE_WARNING, "Received unexpected message -- exiting\n"); | 276 | LOG (GNUNET_ERROR_TYPE_WARNING, "Received unexpected message -- exiting\n"); |
278 | goto error; | 277 | goto error; |
279 | } | 278 | } |
280 | ul_config_size = (uLongf) ntohs (msg->config_size); | 279 | ul_config_size = (uLongf) ntohs (msg->config_size); |
281 | config = GNUNET_malloc (ul_config_size); | 280 | config = GNUNET_malloc (ul_config_size); |
282 | xconfig_size = | 281 | xconfig_size = |
@@ -284,8 +283,8 @@ tokenizer_cb (void *cls, void *client, | |||
284 | sizeof (struct GNUNET_TESTBED_HelperInit)); | 283 | sizeof (struct GNUNET_TESTBED_HelperInit)); |
285 | if (Z_OK != | 284 | if (Z_OK != |
286 | uncompress ((Bytef *) config, &ul_config_size, | 285 | uncompress ((Bytef *) config, &ul_config_size, |
287 | (const Bytef *) (trusted_ip + trusted_ip_size + 1 + hostname_size), | 286 | (const Bytef *) (trusted_ip + trusted_ip_size + 1 + |
288 | (uLongf) xconfig_size)) | 287 | hostname_size), (uLongf) xconfig_size)) |
289 | { | 288 | { |
290 | LOG (GNUNET_ERROR_TYPE_WARNING, | 289 | LOG (GNUNET_ERROR_TYPE_WARNING, |
291 | "Error while uncompressing config -- exiting\n"); | 290 | "Error while uncompressing config -- exiting\n"); |
@@ -306,11 +305,12 @@ tokenizer_cb (void *cls, void *client, | |||
306 | if (0 != hostname_size) | 305 | if (0 != hostname_size) |
307 | { | 306 | { |
308 | hostname = GNUNET_malloc (hostname_size + 1); | 307 | hostname = GNUNET_malloc (hostname_size + 1); |
309 | (void) strncpy (hostname, ((char *) &msg[1]) + trusted_ip_size + 1, hostname_size); | 308 | (void) strncpy (hostname, ((char *) &msg[1]) + trusted_ip_size + 1, |
309 | hostname_size); | ||
310 | hostname[hostname_size] = '\0'; | 310 | hostname[hostname_size] = '\0'; |
311 | } | 311 | } |
312 | test_system = GNUNET_TESTING_system_create ("testbed-helper", trusted_ip, | 312 | test_system = |
313 | hostname); | 313 | GNUNET_TESTING_system_create ("testbed-helper", trusted_ip, hostname); |
314 | GNUNET_free_non_null (hostname); | 314 | GNUNET_free_non_null (hostname); |
315 | hostname = NULL; | 315 | hostname = NULL; |
316 | GNUNET_assert (NULL != test_system); | 316 | GNUNET_assert (NULL != test_system); |
@@ -333,9 +333,8 @@ tokenizer_cb (void *cls, void *client, | |||
333 | testbed = | 333 | testbed = |
334 | GNUNET_OS_start_process (PIPE_CONTROL, | 334 | GNUNET_OS_start_process (PIPE_CONTROL, |
335 | GNUNET_OS_INHERIT_STD_ERR /*verbose? */ , NULL, | 335 | GNUNET_OS_INHERIT_STD_ERR /*verbose? */ , NULL, |
336 | NULL, | 336 | NULL, binary, "gnunet-service-testbed", "-c", |
337 | binary, | 337 | config, NULL); |
338 | "gnunet-service-testbed", "-c", config, NULL); | ||
339 | GNUNET_free (binary); | 338 | GNUNET_free (binary); |
340 | GNUNET_free (config); | 339 | GNUNET_free (config); |
341 | if (NULL == testbed) | 340 | if (NULL == testbed) |