This file is part of GNUnet.
Copyright (C) 2009, 2010, 2012, 2013, 2016 GNUnet e.V.
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
{
const char *pos = (const char *) &lres[1];
uint16_t rcount = ntohs (lres->count);
- uint16_t msize = ntohs (lres->arm_msg.header.size);
+ uint16_t msize = ntohs (lres->arm_msg.header.size) - sizeof (*lres);
uint16_t size_check;
size_check = 0;
uint16_t rcount = ntohs (lres->count);
const char *list[rcount];
const char *pos = (const char *) &lres[1];
- uint16_t msize = ntohs (lres->arm_msg.header.size);
+ uint16_t msize = ntohs (lres->arm_msg.header.size) - sizeof (*lres);
struct GNUNET_ARM_Operation *op;
uint16_t size_check;
uint64_t id;
static int
reconnect_arm (struct GNUNET_ARM_Handle *h)
{
- GNUNET_MQ_hd_fixed_size (arm_result,
- GNUNET_MESSAGE_TYPE_ARM_RESULT,
- struct GNUNET_ARM_ResultMessage);
- GNUNET_MQ_hd_var_size (arm_list_result,
- GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT,
- struct GNUNET_ARM_ListResultMessage);
- GNUNET_MQ_hd_fixed_size (confirm,
- GNUNET_MESSAGE_TYPE_TEST,
- struct GNUNET_MessageHeader);
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_arm_result_handler (h),
- make_arm_list_result_handler (h),
- make_confirm_handler (h),
+ GNUNET_MQ_hd_fixed_size (arm_result,
+ GNUNET_MESSAGE_TYPE_ARM_RESULT,
+ struct GNUNET_ARM_ResultMessage,
+ h),
+ GNUNET_MQ_hd_var_size (arm_list_result,
+ GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT,
+ struct GNUNET_ARM_ListResultMessage,
+ h),
+ GNUNET_MQ_hd_fixed_size (confirm,
+ GNUNET_MESSAGE_TYPE_ARM_TEST,
+ struct GNUNET_MessageHeader,
+ h),
GNUNET_MQ_handler_end ()
};
struct GNUNET_MessageHeader *test;
if (NULL != h->mq)
return GNUNET_OK;
GNUNET_assert (GNUNET_NO == h->currently_up);
- h->mq = GNUNET_CLIENT_connecT (h->cfg,
+ h->mq = GNUNET_CLIENT_connect (h->cfg,
"arm",
handlers,
&mq_error_handler,
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Sending TEST message to ARM\n");
env = GNUNET_MQ_msg (test,
- GNUNET_MESSAGE_TYPE_TEST);
+ GNUNET_MESSAGE_TYPE_ARM_TEST);
GNUNET_MQ_send (h->mq,
env);
return GNUNET_OK;
"PREFIX",
&loprefix))
loprefix = GNUNET_strdup ("");
+ else
+ loprefix = GNUNET_CONFIGURATION_expand_dollar (h->cfg,
+ loprefix);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (h->cfg,
"arm",
"OPTIONS",
&lopostfix))
lopostfix = GNUNET_strdup ("");
+ else
+ lopostfix = GNUNET_CONFIGURATION_expand_dollar (h->cfg,
+ lopostfix);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (h->cfg,
"arm",
loprefix,
quotedbinary,
"-d", /* do daemonize */
- lopostfix, NULL);
+ lopostfix,
+ NULL);
else
proc = GNUNET_OS_start_process_s (GNUNET_NO,
std_inheritance,
slen = strlen (service_name) + 1;
if (slen + sizeof (struct GNUNET_ARM_Message) >=
- GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ GNUNET_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
return NULL;
type);
msg->reserved = htonl (0);
msg->request_id = GNUNET_htonll (op->id);
- memcpy (&msg[1],
+ GNUNET_memcpy (&msg[1],
service_name,
slen);
GNUNET_MQ_send (h->mq,