summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-23 22:34:19 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-23 22:34:19 +0000
commitdf64e68d7a864d9204c44c82cc32696393161bb1 (patch)
treecfd7229c20e2c6465362c2ad156ab29741397c0f
parente5494c55573c92958633c08c906b95d4ce0dc472 (diff)
-fix issues with multi-user setup and ARM
-rw-r--r--po/de.po6
-rw-r--r--po/es.po6
-rw-r--r--po/sv.po6
-rw-r--r--po/vi.po6
-rw-r--r--po/zh_CN.po6
-rw-r--r--src/arm/arm_api.c11
-rw-r--r--src/arm/gnunet-service-arm.c94
7 files changed, 84 insertions, 51 deletions
diff --git a/po/de.po b/po/de.po
index 2dc5731a5..145059278 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNUnet 0.7.0b\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2013-12-23 22:41+0100\n"
+"POT-Creation-Date: 2013-12-23 22:54+0100\n"
"PO-Revision-Date: 2006-03-17 21:37+0100\n"
"Last-Translator: Nils Durner <durner@gnunet.org>\n"
"Language-Team: German <de@li.org>\n"
@@ -4082,6 +4082,10 @@ msgstr ""
msgid "Failed to connect to identity service\n"
msgstr "Es konnte keine Verbindung mit gnunetd hergestellt werden.\n"
+#: src/gns/gnunet-gns-import.c:476
+msgid "This program will import some GNS authorities into your GNS namestore."
+msgstr ""
+
#: src/gns/gnunet-gns-proxy.c:105 src/hostlist/hostlist-client.c:469
#: src/hostlist/hostlist-client.c:683 src/hostlist/hostlist-client.c:689
#: src/hostlist/hostlist-client.c:741 src/hostlist/hostlist-client.c:750
diff --git a/po/es.po b/po/es.po
index 22b2a9682..52088913b 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet 0.9.5a\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2013-12-23 22:41+0100\n"
+"POT-Creation-Date: 2013-12-23 22:54+0100\n"
"PO-Revision-Date: 2013-02-23 17:50+0100\n"
"Last-Translator: Miguel Ángel Arruga Vivas <rosen644835@gmail.com>\n"
"Language-Team: Spanish <es@li.org>\n"
@@ -4087,6 +4087,10 @@ msgstr ""
msgid "Failed to connect to identity service\n"
msgstr "Fallo al conectar a gnunetd.\n"
+#: src/gns/gnunet-gns-import.c:476
+msgid "This program will import some GNS authorities into your GNS namestore."
+msgstr ""
+
#: src/gns/gnunet-gns-proxy.c:105 src/hostlist/hostlist-client.c:469
#: src/hostlist/hostlist-client.c:683 src/hostlist/hostlist-client.c:689
#: src/hostlist/hostlist-client.c:741 src/hostlist/hostlist-client.c:750
diff --git a/po/sv.po b/po/sv.po
index 6d6aa3766..d926abcb9 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNUnet 0.7.0b\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2013-12-23 22:41+0100\n"
+"POT-Creation-Date: 2013-12-23 22:54+0100\n"
"PO-Revision-Date: 2006-01-21 17:16+0100\n"
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
@@ -4031,6 +4031,10 @@ msgstr ""
msgid "Failed to connect to identity service\n"
msgstr "Misslyckades att ansluta till gnunetd.\n"
+#: src/gns/gnunet-gns-import.c:476
+msgid "This program will import some GNS authorities into your GNS namestore."
+msgstr ""
+
#: src/gns/gnunet-gns-proxy.c:105 src/hostlist/hostlist-client.c:469
#: src/hostlist/hostlist-client.c:683 src/hostlist/hostlist-client.c:689
#: src/hostlist/hostlist-client.c:741 src/hostlist/hostlist-client.c:750
diff --git a/po/vi.po b/po/vi.po
index da8a08d6d..5a6ed8844 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet 0.8.0a\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2013-12-23 22:41+0100\n"
+"POT-Creation-Date: 2013-12-23 22:54+0100\n"
"PO-Revision-Date: 2008-09-10 22:05+0930\n"
"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
@@ -4082,6 +4082,10 @@ msgstr ""
msgid "Failed to connect to identity service\n"
msgstr "Lỗi kết nối đến gnunetd.\n"
+#: src/gns/gnunet-gns-import.c:476
+msgid "This program will import some GNS authorities into your GNS namestore."
+msgstr ""
+
#: src/gns/gnunet-gns-proxy.c:105 src/hostlist/hostlist-client.c:469
#: src/hostlist/hostlist-client.c:683 src/hostlist/hostlist-client.c:689
#: src/hostlist/hostlist-client.c:741 src/hostlist/hostlist-client.c:750
diff --git a/po/zh_CN.po b/po/zh_CN.po
index c9e9ee1ba..4b9ae77f0 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnunet-0.8.1\n"
"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
-"POT-Creation-Date: 2013-12-23 22:41+0100\n"
+"POT-Creation-Date: 2013-12-23 22:54+0100\n"
"PO-Revision-Date: 2011-07-09 12:12+0800\n"
"Last-Translator: Wylmer Wang <wantinghard@gmail.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
@@ -3879,6 +3879,10 @@ msgstr ""
msgid "Failed to connect to identity service\n"
msgstr "初始化“%s”服务失败。\n"
+#: src/gns/gnunet-gns-import.c:476
+msgid "This program will import some GNS authorities into your GNS namestore."
+msgstr ""
+
#: src/gns/gnunet-gns-proxy.c:105 src/hostlist/hostlist-client.c:469
#: src/hostlist/hostlist-client.c:683 src/hostlist/hostlist-client.c:689
#: src/hostlist/hostlist-client.c:741 src/hostlist/hostlist-client.c:750
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 6c0dec4a6..ee699739a 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -308,11 +308,12 @@ arm_termination_handler (void *cls, const struct GNUNET_MessageHeader *msg)
/**
* Handler for ARM replies.
*
- * @param cls our "struct GNUNET_ARM_Handle"
+ * @param cls our `struct GNUNET_ARM_Handle`
* @param msg the message received from the arm service
*/
static void
-client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
+client_notify_handler (void *cls,
+ const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_ARM_Handle *h = cls;
const struct GNUNET_ARM_Message *arm_msg;
@@ -353,7 +354,9 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
cm = find_cm_by_id (h, id);
if (NULL == cm)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Message with unknown id %llu\n", id);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Message with unknown id %llu\n",
+ id);
return;
}
fail = GNUNET_NO;
@@ -460,7 +463,7 @@ client_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
if (NULL != cm->list_cont)
cm->list_cont (cm->cont_cls, GNUNET_ARM_REQUEST_SENT_OK, rcount,
list);
- GNUNET_free (list);
+ GNUNET_free_non_null (list);
break;
}
GNUNET_free (cm->msg);
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 704b6f2fc..af232b11c 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -260,7 +260,7 @@ write_result (void *cls, size_t size, void *buf)
struct GNUNET_ARM_ResultMessage *msg = cls;
size_t msize;
- if (buf == NULL)
+ if (NULL == buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Could not send status result to client\n"));
@@ -296,7 +296,7 @@ write_list_result (void *cls, size_t size, void *buf)
struct GNUNET_ARM_ListResultMessage *msg = cls;
size_t rslt_size;
- if (buf == NULL)
+ if (NULL == buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Could not send list result to client\n"));
@@ -525,14 +525,19 @@ start_process (struct ServiceList *sl,
GNUNET_free (quotedbinary);
if (sl->proc == NULL)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to start service `%s'\n"),
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Failed to start service `%s'\n"),
sl->name);
if (client)
- signal_result (client, sl->name, request_id, GNUNET_ARM_RESULT_START_FAILED);
+ signal_result (client,
+ sl->name,
+ request_id,
+ GNUNET_ARM_RESULT_START_FAILED);
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Starting service `%s'\n"),
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Starting service `%s'\n"),
sl->name);
broadcast_status (sl->name, GNUNET_ARM_SERVICE_STARTING, NULL);
if (client)
@@ -903,7 +908,7 @@ handle_list (void *cls, struct GNUNET_SERVER_Client *client,
/* first count the running processes get their name's size */
for (sl = running_head; NULL != sl; sl = sl->next)
{
- if (sl->proc != NULL)
+ if (NULL != sl->proc)
{
string_list_size += strlen (sl->name);
string_list_size += strlen (sl->binary);
@@ -922,20 +927,19 @@ handle_list (void *cls, struct GNUNET_SERVER_Client *client,
msg->count = count;
char *pos = (char *)&msg[1];
- for (sl = running_head; sl != NULL; sl = sl->next)
+ for (sl = running_head; NULL != sl; sl = sl->next)
{
- if (sl->proc != NULL)
+ if (NULL != sl->proc)
{
size_t s = strlen (sl->name) + strlen (sl->binary) + 4;
- GNUNET_snprintf(pos, s, "%s (%s)", sl->name, sl->binary);
+ GNUNET_snprintf (pos, s, "%s (%s)", sl->name, sl->binary);
pos += s;
}
}
-
GNUNET_SERVER_notify_transmit_ready (client,
total_size,
GNUNET_TIME_UNIT_FOREVER_REL,
- write_list_result, msg);
+ &write_list_result, msg);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@ -966,6 +970,12 @@ do_shutdown ()
}
+/**
+ * Count how many services are still active.
+ *
+ * @param running_head list of services
+ * @return number of active services found
+ */
static unsigned int
list_count (struct ServiceList *running_head)
{
@@ -1442,8 +1452,9 @@ run (void *cls, struct GNUNET_SERVER_Handle *serv,
cfg = c;
server = serv;
- GNUNET_assert (serv != NULL);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
+ GNUNET_assert (NULL != serv);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &shutdown_task,
NULL);
child_death_task =
GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -1464,50 +1475,49 @@ run (void *cls, struct GNUNET_SERVER_Handle *serv,
{
GNUNET_break (GNUNET_YES == start_user);
start_system = GNUNET_NO;
- return;
}
if (GNUNET_YES ==
GNUNET_CONFIGURATION_get_value_yesno (cfg, "ARM", "SYSTEM_ONLY"))
{
GNUNET_break (GNUNET_YES == start_system);
start_user = GNUNET_NO;
- return;
}
GNUNET_CONFIGURATION_iterate_sections (cfg, &setup_service, NULL);
/* start default services... */
if (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_string (cfg, "ARM", "DEFAULTSERVICES",
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "ARM",
+ "DEFAULTSERVICES",
&defaultservices))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Starting default services `%s'\n"),
+ defaultservices);
+ if (0 < strlen (defaultservices))
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Starting default services `%s'\n"), defaultservices);
- if (0 < strlen (defaultservices))
- {
- for (pos = strtok (defaultservices, " "); NULL != pos;
- pos = strtok (NULL, " "))
- {
- sl = find_service (pos);
- if (NULL == sl)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _
- ("Default service `%s' not configured correctly!\n"),
- pos);
- continue;
- }
- sl->is_default = GNUNET_YES;
- start_process (sl, NULL, 0);
- }
- }
- GNUNET_free (defaultservices);
+ for (pos = strtok (defaultservices, " "); NULL != pos;
+ pos = strtok (NULL, " "))
+ {
+ sl = find_service (pos);
+ if (NULL == sl)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Default service `%s' not configured correctly!\n"),
+ pos);
+ continue;
+ }
+ sl->is_default = GNUNET_YES;
+ start_process (sl, NULL, 0);
+ }
}
+ GNUNET_free (defaultservices);
+ }
else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _
- ("No default services configured, GNUnet will not really start right now.\n"));
- }
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("No default services configured, GNUnet will not really start right now.\n"));
+ }
notifier =
GNUNET_SERVER_notification_context_create (server, MAX_NOTIFY_QUEUE);