/*
This file is part of GNUnet.
- (C) 2013, 2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2013, 2014 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
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
{
ret = 0;
fprintf (stdout,
- "%s%s\n",
- (0 > gcry_mpi_cmp_ui (result, 0)) ? "-" : "",
+ "%s\n",
buf);
fflush (stdout);
}
* @param tc unused
*/
static void
-shutdown_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
if (NULL != computation)
{
input_peer_id);
return;
}
-
+ if ( ('\'' == *begin) &&
+ ('\'' == begin[strlen(begin)-1]) )
+ {
+ begin[strlen(begin)-1] = '\0';
+ if (strlen (begin) > 0)
+ begin++;
+ }
for (end = begin; 0 != *end; end++)
if (*end == ';')
element_count++;
- if (0 == element_count) {
+ if (0 == element_count)
+ {
LOG (GNUNET_ERROR_TYPE_ERROR,
- _("Need elements to compute the vectorproduct, got none.\n"));
+ _("Need elements to compute the scalarproduct, got none.\n"));
return;
}
GNUNET_free (elements);
return;
}
-
- /* read the element's key */
*separator = 0;
+ /* read the element's key */
GNUNET_CRYPTO_hash (begin,
strlen (begin),
&element.key);
&responder_callback,
NULL))) ) )
{
- GNUNET_break (0);
+ fprintf (stderr,
+ _("Failed to initiate computation, were all keys unique?\n"));
GNUNET_free (elements);
return;
}
GNUNET_free (elements);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &shutdown_task,
- NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
ret = 0;
}