X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fchat%2Ftest_chat.c;h=24a1e38da8551cbebd64c6c8745252c52be51fb0;hb=d0b4927e6ab7e8b9874dd7807055e77fb4c5163f;hp=fec5db02a3f25e827ce94cb124596cbee9a3a9e7;hpb=0238db34853380280ccf164918ebbb28260f4629;p=oweals%2Fgnunet.git diff --git a/src/chat/test_chat.c b/src/chat/test_chat.c index fec5db02a..24a1e38da 100644 --- a/src/chat/test_chat.c +++ b/src/chat/test_chat.c @@ -58,7 +58,7 @@ struct Wanted { struct GNUNET_CONTAINER_MetaData *meta; - GNUNET_HashCode *sender; + struct GNUNET_HashCode *sender; char *msg; @@ -80,9 +80,9 @@ static struct PeerContext p1; 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; @@ -116,17 +116,18 @@ static int is_auth; 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 (GNUNET_YES, 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); } @@ -140,7 +141,7 @@ stop_arm (struct PeerContext *p) 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); @@ -201,7 +202,7 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info, 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, @@ -213,7 +214,7 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info, 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)))) && @@ -234,7 +235,7 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info, 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) @@ -250,7 +251,7 @@ receive_cb (void *cls, struct GNUNET_CHAT_Room *room, 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 @@ -275,7 +276,7 @@ static int 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; @@ -285,7 +286,7 @@ confirmation_cb (void *cls, struct GNUNET_CHAT_Room *room, 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)) {