gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11537 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r11537 - gnunet/src/transport
Date: Thu, 27 May 2010 15:57:41 +0200

Author: wachs
Date: 2010-05-27 15:57:41 +0200 (Thu, 27 May 2010)
New Revision: 11537

Modified:
   gnunet/src/transport/test_plugin_transport_http.c
Log:


Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c   2010-05-27 13:31:42 UTC 
(rev 11536)
+++ gnunet/src/transport/test_plugin_transport_http.c   2010-05-27 13:57:41 UTC 
(rev 11537)
@@ -52,7 +52,7 @@
 /**
  * How long until we give up on transmitting the message?
  */
-#define STAT_INTERVALL GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 3)
+#define STAT_INTERVALL GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 10)
 
 /**
  * Our public key.
@@ -111,11 +111,12 @@
  */
 static GNUNET_SCHEDULER_TaskIdentifier ti_timeout;
 
-#if 0
-static GNUNET_SCHEDULER_TaskIdentifier ti_download;
-#endif
 
+static GNUNET_SCHEDULER_TaskIdentifier ti_send;
+
 static unsigned int timeout_count;
+static unsigned int recieved;
+const struct GNUNET_PeerIdentity * p;
 
 /**
  * Did the test pass or fail?
@@ -126,6 +127,22 @@
 
 pid_t pid;
 
+static void
+task_send (void *cls,
+            const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  ti_timeout = GNUNET_SCHEDULER_NO_TASK;
+  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
+    return;
+
+  struct GNUNET_MessageHeader * msg = cls;
+  unsigned int len = ntohs(msg->size);
+  const char * msgc = (const char *) msg;
+
+  api->send(api->cls,p,msgc, len, 0, TIMEOUT, NULL,NULL, 0, GNUNET_NO, NULL, 
NULL);
+
+}
+
 /**
  * Initialize Environment for this plugin
  */
@@ -140,6 +157,13 @@
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testcase recieved new message from 
peer `%s' with type %u and length %u\n",  
GNUNET_i2s(peer),ntohs(message->type),ntohs(message->size));
 
+
+
+  recieved = GNUNET_YES;
+  p = peer;
+  void * c = (void *) message;
+
+  ti_send =GNUNET_SCHEDULER_add_delayed (sched, STAT_INTERVALL, &task_send, c);
   return GNUNET_TIME_UNIT_ZERO;
 }
 
@@ -229,6 +253,8 @@
 }
 #endif
 
+
+
 /**
  * Task that checks if we should try to download a hostlist.
  * If so, we initiate the download, otherwise we schedule




reply via email to

[Prev in Thread] Current Thread [Next in Thread]