/**
* Callback called if we are initiating a new computation session
- *
+ *
* @param cls unused
- * @param status if our job was successfully processed
+ * @param status if our job was successfully processed
*/
static void
responder_callback (void *cls,
default:
LOG (GNUNET_ERROR_TYPE_ERROR, "Session %s failed: return code %d\n", GNUNET_h2s (&closure->key), status);
}
+ GNUNET_SCHEDULER_shutdown();
}
/**
* Callback called if we are initiating a new computation session
- *
+ *
* @param cls unused
* @param key unused
* @param peer unused
- * @param status if our job was successfully processed
+ * @param status if our job was successfully processed
* @param size size of the msg returned
* @param msg the response we got.
- * @param type of the message received
+ * @param type of the message received
*/
static void
requester_callback (void *cls,
default:
LOG (GNUNET_ERROR_TYPE_ERROR, "Session %s with peer %s failed: return code %d\n", GNUNET_h2s (&closure->key), GNUNET_i2s (&closure->peer), status);
}
+ GNUNET_SCHEDULER_shutdown();
}
/**
// get the length of the current element and replace , with null
for (end = begin; *end && *end != ','; end++);
- if (1 == sscanf (begin, "%" SCNd32",", &element))
+ if (1 == sscanf (begin, "%" SCNd32 ",", &element))
{
//element in the middle
element_count++;
begin = end + 1;
}
- else if (*begin == 0)
+ else if (0 == *begin)
{
break;
}
while (1);
if (0 == element_count)
{
-
+ LOG (GNUNET_ERROR_TYPE_ERROR, _ ("Need elements to compute the vectorproduct, got none.\n"));
return;
}
begin = input_elements;
elements = GNUNET_malloc (sizeof (int32_t) * element_count);
+ element_count = 0;
/* Read input_elements_peer1, and put in elements_peer1 array */
do
{
// get the length of the current element and replace , with null
for (end = begin; *end && *end != ','; end++);
- if (1 == sscanf (begin, "%" SCNd32",", &element))
+ if (1 == sscanf (begin, "%" SCNd32 ",", &elements[element_count]))
{
//element in the middle
element_count++;
begin = end + 1;
}
- else if (*begin == 0)
+ else if (0 == *begin)
{
break;
}
while (1);
mask_bytes = element_count / 8 + (element_count % 8 ? 1 : 0);
- mask = GNUNET_malloc ((element_count / 8) + 2);
+ mask = GNUNET_malloc ((element_count / 8) + 1);
/* Read input_mask_peer1 and read in mask_peer1 array */
if ((NULL != input_peer_id) && (NULL != input_mask))
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&shutdown_task,
NULL);
-
+
ret = 0;
}