aboutsummaryrefslogtreecommitdiff
path: root/src/arm/gnunet-service-arm.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-05-29 02:39:55 +0000
committerChristian Grothoff <christian@grothoff.org>2009-05-29 02:39:55 +0000
commit36ccc5b502d85f9fcf212e30fa9f1a0787de73ab (patch)
tree4020c41421f7a5df3cee172e128a07047eaf3848 /src/arm/gnunet-service-arm.c
parent9bf34bae8102d0c20b36008ce10c2695a658c4d5 (diff)
downloadgnunet-36ccc5b502d85f9fcf212e30fa9f1a0787de73ab.tar.gz
gnunet-36ccc5b502d85f9fcf212e30fa9f1a0787de73ab.zip
removing server from argument list, other minor fixes
Diffstat (limited to 'src/arm/gnunet-service-arm.c')
-rw-r--r--src/arm/gnunet-service-arm.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 97d507890..c9736982f 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -327,8 +327,7 @@ start_process (struct ServiceList *sl)
327 * Start the specified service. 327 * Start the specified service.
328 */ 328 */
329static void 329static void
330start_service (struct GNUNET_SERVER_Handle *server, 330start_service (struct GNUNET_SERVER_Client *client, const char *servicename)
331 struct GNUNET_SERVER_Client *client, const char *servicename)
332{ 331{
333 struct ServiceList *sl; 332 struct ServiceList *sl;
334 char *binary; 333 char *binary;
@@ -368,6 +367,7 @@ start_service (struct GNUNET_SERVER_Handle *server,
368 config, servicename); 367 config, servicename);
369 signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN); 368 signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN);
370 GNUNET_free (binary); 369 GNUNET_free (binary);
370 GNUNET_free (config);
371 return; 371 return;
372 } 372 }
373 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 373 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -403,8 +403,7 @@ free_and_signal (void *cls, struct ServiceList *pos)
403 * Stop the specified service. 403 * Stop the specified service.
404 */ 404 */
405static void 405static void
406stop_service (struct GNUNET_SERVER_Handle *server, 406stop_service (struct GNUNET_SERVER_Client *client, const char *servicename)
407 struct GNUNET_SERVER_Client *client, const char *servicename)
408{ 407{
409 struct ServiceList *pos; 408 struct ServiceList *pos;
410 struct GNUNET_CLIENT_Connection *sc; 409 struct GNUNET_CLIENT_Connection *sc;
@@ -412,7 +411,7 @@ stop_service (struct GNUNET_SERVER_Handle *server,
412 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 411 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
413 "Preparing to stop `%s'\n", servicename); 412 "Preparing to stop `%s'\n", servicename);
414 pos = find_name (servicename); 413 pos = find_name (servicename);
415 if (pos->kill_continuation != NULL) 414 if ((pos != NULL) && (pos->kill_continuation != NULL))
416 { 415 {
417 /* killing already in progress */ 416 /* killing already in progress */
418 signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN); 417 signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN);
@@ -453,7 +452,6 @@ stop_service (struct GNUNET_SERVER_Handle *server,
453 * Handle START-message. 452 * Handle START-message.
454 * 453 *
455 * @param cls closure (always NULL) 454 * @param cls closure (always NULL)
456 * @param server the server handling the message
457 * @param client identification of the client 455 * @param client identification of the client
458 * @param message the actual message 456 * @param message the actual message
459 * @return GNUNET_OK to keep the connection open, 457 * @return GNUNET_OK to keep the connection open,
@@ -461,7 +459,6 @@ stop_service (struct GNUNET_SERVER_Handle *server,
461 */ 459 */
462static void 460static void
463handle_start (void *cls, 461handle_start (void *cls,
464 struct GNUNET_SERVER_Handle *server,
465 struct GNUNET_SERVER_Client *client, 462 struct GNUNET_SERVER_Client *client,
466 const struct GNUNET_MessageHeader *message) 463 const struct GNUNET_MessageHeader *message)
467{ 464{
@@ -477,7 +474,7 @@ handle_start (void *cls,
477 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 474 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
478 return; 475 return;
479 } 476 }
480 start_service (server, client, servicename); 477 start_service (client, servicename);
481 GNUNET_SERVER_receive_done (client, GNUNET_OK); 478 GNUNET_SERVER_receive_done (client, GNUNET_OK);
482} 479}
483 480
@@ -486,7 +483,6 @@ handle_start (void *cls,
486 * Handle STOP-message. 483 * Handle STOP-message.
487 * 484 *
488 * @param cls closure (always NULL) 485 * @param cls closure (always NULL)
489 * @param server the server handling the message
490 * @param client identification of the client 486 * @param client identification of the client
491 * @param message the actual message 487 * @param message the actual message
492 * @return GNUNET_OK to keep the connection open, 488 * @return GNUNET_OK to keep the connection open,
@@ -494,7 +490,6 @@ handle_start (void *cls,
494 */ 490 */
495static void 491static void
496handle_stop (void *cls, 492handle_stop (void *cls,
497 struct GNUNET_SERVER_Handle *server,
498 struct GNUNET_SERVER_Client *client, 493 struct GNUNET_SERVER_Client *client,
499 const struct GNUNET_MessageHeader *message) 494 const struct GNUNET_MessageHeader *message)
500{ 495{
@@ -510,7 +505,7 @@ handle_stop (void *cls,
510 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 505 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
511 return; 506 return;
512 } 507 }
513 stop_service (server, client, servicename); 508 stop_service (client, servicename);
514} 509}
515 510
516 511
@@ -669,7 +664,7 @@ run (void *cls,
669 pos = strtok (defaultservices, " "); 664 pos = strtok (defaultservices, " ");
670 while (pos != NULL) 665 while (pos != NULL)
671 { 666 {
672 start_service (server, NULL, pos); 667 start_service (NULL, pos);
673 pos = strtok (NULL, " "); 668 pos = strtok (NULL, " ");
674 } 669 }
675 GNUNET_free (defaultservices); 670 GNUNET_free (defaultservices);