/*
This file is part of GNUnet.
- (C) 2013, 2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2013, 2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
{
switch (status)
{
- case GNUNET_SCALARPRODUCT_Status_Success:
+ case GNUNET_SCALARPRODUCT_STATUS_SUCCESS:
ret = 0;
LOG (GNUNET_ERROR_TYPE_INFO,
"Session %s concluded.\n",
GNUNET_h2s (&session_key));
break;
- case GNUNET_SCALARPRODUCT_Status_InvalidResponse:
+ case GNUNET_SCALARPRODUCT_STATUS_INVALID_RESPONSE:
LOG (GNUNET_ERROR_TYPE_ERROR,
"Session %s failed: invalid response\n",
GNUNET_h2s (&session_key));
break;
- case GNUNET_SCALARPRODUCT_Status_Failure:
+ case GNUNET_SCALARPRODUCT_STATUS_FAILURE:
LOG (GNUNET_ERROR_TYPE_ERROR,
"Session %s failed: service failure\n",
GNUNET_h2s (&session_key));
break;
- case GNUNET_SCALARPRODUCT_Status_ServiceDisconnected:
+ case GNUNET_SCALARPRODUCT_STATUS_DISCONNECTED:
LOG (GNUNET_ERROR_TYPE_ERROR,
"Session %s failed: service disconnect!\n",
GNUNET_h2s (&session_key));
switch (status)
{
- case GNUNET_SCALARPRODUCT_Status_Success:
+ case GNUNET_SCALARPRODUCT_STATUS_SUCCESS:
if (0 == (rc = gcry_mpi_aprint (GCRYMPI_FMT_HEX, &buf, NULL, result)))
{
ret = 0;
- printf ("%s", buf);
+ fprintf (stdout,
+ "%s\n",
+ buf);
+ fflush (stdout);
}
else
LOG_GCRY (GNUNET_ERROR_TYPE_ERROR,
"gcry_mpi_aprint",
rc);
break;
- case GNUNET_SCALARPRODUCT_Status_InvalidResponse:
+ case GNUNET_SCALARPRODUCT_STATUS_INVALID_RESPONSE:
LOG (GNUNET_ERROR_TYPE_ERROR,
"Session %s with peer %s failed: invalid response received\n",
GNUNET_h2s (&session_key),
GNUNET_i2s (&peer_id));
break;
- case GNUNET_SCALARPRODUCT_Status_Failure:
+ case GNUNET_SCALARPRODUCT_STATUS_FAILURE:
LOG (GNUNET_ERROR_TYPE_ERROR,
"Session %s with peer %s failed: API failure\n",
GNUNET_h2s (&session_key),
GNUNET_i2s (&peer_id));
break;
- case GNUNET_SCALARPRODUCT_Status_ServiceDisconnected:
+ case GNUNET_SCALARPRODUCT_STATUS_DISCONNECTED:
LOG (GNUNET_ERROR_TYPE_ERROR,
"Session %s with peer %s was disconnected from service.\n",
GNUNET_h2s (&session_key),
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;
}