#include "gnunet_arm_service.h"
#include "gnunet_chat_service.h"
-#define VERBOSE GNUNET_EXTRA_LOGGING
+#define VERBOSE GNUNET_NO
#define START_ARM GNUNET_YES
{
struct GNUNET_CONTAINER_MetaData *meta;
- GNUNET_HashCode *sender;
+ struct GNUNET_HashCode *sender;
char *msg;
static struct PeerContext p2;
-static GNUNET_HashCode alice;
+static struct GNUNET_HashCode alice;
-static GNUNET_HashCode bob;
+static struct GNUNET_HashCode bob;
static struct GNUNET_CHAT_Room *alice_room;
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
"gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
"-c", cfgname, NULL);
#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
+ GNUNET_free (binary);
}
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n",
GNUNET_OS_process_get_pid (p->arm_proc));
- GNUNET_OS_process_close (p->arm_proc);
+ GNUNET_OS_process_destroy (p->arm_proc);
p->arm_proc = NULL;
#endif
GNUNET_CONFIGURATION_destroy (p->cfg);
enum GNUNET_CHAT_MsgOptions options)
{
struct Wanted *want = cls;
- GNUNET_HashCode sender;
+ struct GNUNET_HashCode sender;
#if VERBOSE
printf ("%s - told that %s has %s\n", want->me,
GNUNET_CRYPTO_hash (member_id,
sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
&sender);
- if ((0 == memcmp (&sender, want->sender, sizeof (GNUNET_HashCode))) &&
+ if ((0 == memcmp (&sender, want->sender, sizeof (struct GNUNET_HashCode))) &&
(((member_info == NULL) && (want->meta == NULL)) ||
((member_info != NULL) && (want->meta != NULL) &&
(GNUNET_CONTAINER_meta_data_test_equal (member_info, want->meta)))) &&
static int
receive_cb (void *cls, struct GNUNET_CHAT_Room *room,
- const GNUNET_HashCode * sender,
+ const struct GNUNET_HashCode * sender,
const struct GNUNET_CONTAINER_MetaData *meta, const char *message,
struct GNUNET_TIME_Absolute timestamp,
enum GNUNET_CHAT_MsgOptions options)
if ((0 == strcmp (message, want->msg)) &&
(((sender == NULL) && (want->sender == NULL)) ||
((sender != NULL) && (want->sender != NULL) &&
- (0 == memcmp (sender, want->sender, sizeof (GNUNET_HashCode))))) &&
+ (0 == memcmp (sender, want->sender, sizeof (struct GNUNET_HashCode))))) &&
(GNUNET_CONTAINER_meta_data_test_equal (meta, want->meta)) &&
(options == want->opt) &&
/* Not == since the library sets the actual timestamp, so it may be
confirmation_cb (void *cls, struct GNUNET_CHAT_Room *room,
uint32_t orig_seq_number,
struct GNUNET_TIME_Absolute timestamp,
- const GNUNET_HashCode * receiver)
+ const struct GNUNET_HashCode * receiver)
{
struct Wanted *want = cls;
EXTRACTOR_METATYPE_TITLE),
orig_seq_number);
#endif
- if ((0 == memcmp (receiver, want->sender, sizeof (GNUNET_HashCode))) &&
+ if ((0 == memcmp (receiver, want->sender, sizeof (struct GNUNET_HashCode))) &&
(orig_seq_number == want->sequence_number) &&
(timestamp.abs_value >= want->timestamp.abs_value))
{