[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6968 - in GNUnet/src/applications/chat: lib module
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6968 - in GNUnet/src/applications/chat: lib module |
Date: |
Sun, 1 Jun 2008 11:19:03 -0600 (MDT) |
Author: grothoff
Date: 2008-06-01 11:19:02 -0600 (Sun, 01 Jun 2008)
New Revision: 6968
Modified:
GNUnet/src/applications/chat/lib/loopback_test.c
GNUnet/src/applications/chat/module/chat.c
Log:
finishing test
Modified: GNUnet/src/applications/chat/lib/loopback_test.c
===================================================================
--- GNUnet/src/applications/chat/lib/loopback_test.c 2008-06-01 17:11:56 UTC
(rev 6967)
+++ GNUnet/src/applications/chat/lib/loopback_test.c 2008-06-01 17:19:02 UTC
(rev 6968)
@@ -27,8 +27,8 @@
* TODO:
* - test private messages (need more than 2 users!)
* - test anonymous messages
- * - test acknowledgements
- * - test authenticated message
+ * - test acknowledgements (verify sig!)
+ * - test authenticated message (flags only)
*/
#include "platform.h"
@@ -42,6 +42,8 @@
#define START_PEERS 1
+#define DEBUG 0
+
static unsigned int error;
struct Wanted {
@@ -71,11 +73,13 @@
{
struct Wanted * want = cls;
+#if DEBUG
fprintf(stderr, "%s - told that %s says %s\n",
want->me,
member_info == NULL ? NULL
: GNUNET_ECRS_meta_data_get_by_type(member_info, EXTRACTOR_TITLE),
message);
+#endif
GNUNET_semaphore_down(want->pre, GNUNET_YES);
if (! ( (0 == strcmp(message, want->msg)) &&
( ( (sender == NULL) && (want->sender == NULL) ) ||
@@ -102,10 +106,12 @@
struct Wanted * want = cls;
GNUNET_HashCode sender;
+#if DEBUG
fprintf(stderr, "%s - told that %s joins\n",
want->me,
member_info == NULL ? NULL
: GNUNET_ECRS_meta_data_get_by_type(member_info, EXTRACTOR_TITLE));
+#endif
GNUNET_semaphore_down(want->pre, GNUNET_YES);
GNUNET_hash(member_id,
sizeof(GNUNET_RSA_PublicKey),
@@ -198,8 +204,10 @@
"Bob");
/* alice joining */
+#if DEBUG
fprintf(stderr,
"Alice joining\n");
+#endif
alice_wanted.recv = GNUNET_semaphore_create(0);
alice_wanted.pre = GNUNET_semaphore_create(1);
alice_wanted.meta = meta1;
@@ -221,8 +229,10 @@
check_down(&alice_wanted);
/* bob joining */
+#if DEBUG
fprintf(stderr,
"Bob joining\n");
+#endif
alice_wanted.meta = meta2;
alice_wanted.sender = &bob;
alice_wanted.msg = NULL;
@@ -258,8 +268,10 @@
/* end of Bob joining */
/* alice to bob */
+#if DEBUG
fprintf(stderr,
"Alice says 'Hi!'\n");
+#endif
GNUNET_CHAT_send_message (r1, "Hi!",
GNUNET_CHAT_MSG_OPTION_NONE, NULL, &seq);
alice_wanted.meta = meta1;
@@ -276,12 +288,31 @@
check_down(&bob_wanted);
-#if 0
/* bob to alice */
+#if DEBUG
+ fprintf(stderr,
+ "Bob says 'Rehi!'\n");
+#endif
GNUNET_CHAT_send_message (r2, "Rehi!",
GNUNET_CHAT_MSG_OPTION_NONE, NULL, &seq);
+ alice_wanted.meta = meta2;
+ alice_wanted.sender = &bob;
+ alice_wanted.msg = "Rehi!";
+ alice_wanted.opt = 0;
+ GNUNET_semaphore_up(alice_wanted.pre);
+ bob_wanted.meta = meta2;
+ bob_wanted.sender = &bob;
+ bob_wanted.msg = "Rehi!";
+ bob_wanted.opt = 0;
+ GNUNET_semaphore_up(bob_wanted.pre);
+ check_down(&alice_wanted);
+ check_down(&bob_wanted);
+
+ /* alice leaving */
+#if DEBUG
+ fprintf(stderr,
+ "Alice is leaving.\n");
#endif
- /* alice leaving */
GNUNET_CHAT_leave_room (r1);
r1 = NULL;
bob_wanted.meta = NULL;
@@ -292,6 +323,10 @@
check_down(&bob_wanted);
/* bob leaving */
+#if DEBUG
+ fprintf(stderr,
+ "Bob is leaving.\n");
+#endif
GNUNET_CHAT_leave_room (r2);
r2 = NULL;
Modified: GNUnet/src/applications/chat/module/chat.c
===================================================================
--- GNUnet/src/applications/chat/module/chat.c 2008-06-01 17:11:56 UTC (rev
6967)
+++ GNUnet/src/applications/chat/module/chat.c 2008-06-01 17:19:02 UTC (rev
6968)
@@ -29,6 +29,8 @@
* TODO:
* - signatures are currently always generated for the
* plaintext, even if ciphertext was requested
+ * - consider keeping private keys entirely on the
+ * client side (tricky bit: generating Confirmations)
*/
#include "platform.h"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6968 - in GNUnet/src/applications/chat: lib module,
gnunet <=