gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10768 - gnunet/src/dv


From: gnunet
Subject: [GNUnet-SVN] r10768 - gnunet/src/dv
Date: Sat, 3 Apr 2010 16:27:50 +0200

Author: nevans
Date: 2010-04-03 16:27:50 +0200 (Sat, 03 Apr 2010)
New Revision: 10768

Modified:
   gnunet/src/dv/dv_api.c
   gnunet/src/dv/gnunet-service-dv.c
   gnunet/src/dv/plugin_transport_dv.c
   gnunet/src/dv/test_transport_api_dv.c
   gnunet/src/dv/test_transport_api_dv_peer1.conf
   gnunet/src/dv/test_transport_api_dv_peer2.conf
   gnunet/src/dv/test_transport_api_dv_peer3.conf
Log:
lots of fixes, on its way to actually working...

Modified: gnunet/src/dv/dv_api.c
===================================================================
--- gnunet/src/dv/dv_api.c      2010-04-03 10:38:02 UTC (rev 10767)
+++ gnunet/src/dv/dv_api.c      2010-04-03 14:27:50 UTC (rev 10768)
@@ -170,8 +170,15 @@
   size_t ret;
   size_t tsize;
 
+#if DEBUG_DV
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV API: Transmit pending called with 
message type %d\n", ntohs(handle->current->msg->header.type));
+#endif
+
   if (buf == NULL)
     {
+#if DEBUG_DV
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV API: Transmit pending 
FAILED!\n\n\n");
+#endif
       finish(handle, GNUNET_SYSERR);
       return 0;
     }
@@ -185,11 +192,13 @@
     if (size >= tsize)
     {
       memcpy(buf, handle->current->msg, tsize);
+#if DEBUG_DV
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV API: Copied %d bytes into 
buffer!\n\n\n", tsize);
+#endif
+      finish(handle, GNUNET_OK);
+      return tsize;
     }
-    else
-    {
-      return ret;
-    }
+
   }
 
   return ret;
@@ -200,7 +209,6 @@
  */
 static void process_pending_message(struct GNUNET_DV_Handle *handle)
 {
-  struct GNUNET_TIME_Relative timeout;
 
   if (handle->current != NULL)
     return;                     /* action already pending */
@@ -224,11 +232,10 @@
   handle->pending_list = handle->pending_list->next;
   handle->current->next = NULL;
 
-  timeout = GNUNET_TIME_absolute_get_remaining (handle->current->timeout);
   if (NULL ==
       (handle->th = GNUNET_CLIENT_notify_transmit_ready (handle->client,
                                                     
ntohs(handle->current->msg->msgbuf_size),
-                                                    timeout,
+                                                    
handle->current->msg->timeout,
                                                     GNUNET_YES,
                                                     &transmit_pending, 
handle)))
     {
@@ -285,6 +292,7 @@
   size_t sender_address_len;
   char *sender_address;
   char *packed_msg;
+  char *packed_msg_start;
 
   if (msg == NULL)
   {
@@ -299,16 +307,20 @@
   received_msg = (struct GNUNET_DV_MessageReceived *)msg;
   packed_msg_len = ntohs(received_msg->msg_len);
   sender_address_len = ntohs(received_msg->sender_address_len);
+
+  GNUNET_assert(ntohs(msg->size) == (sizeof(struct GNUNET_DV_MessageReceived) 
+ packed_msg_len + sender_address_len));
 #if DEBUG_DV
-  fprintf(stdout, "dv api receives message from service: total len: %lu, 
packed len: %lu, sender_address_len: %lu, base message len: %lu\ntotal is %lu, 
should be %lu\n", ntohs(msg->size), packed_msg_len, sender_address_len, 
sizeof(struct GNUNET_DV_MessageReceived), sizeof(struct 
GNUNET_DV_MessageReceived) + packed_msg_len + sender_address_len, 
ntohs(msg->size));
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "dv api receives message, size checks 
out!\n");
 #endif
-  GNUNET_assert(ntohs(msg->size) == (sizeof(struct GNUNET_DV_MessageReceived) 
+ packed_msg_len + sender_address_len));
-
   sender_address = GNUNET_malloc(sender_address_len);
   memcpy(sender_address, &received_msg[1], sender_address_len);
+  packed_msg_start = (char *)&received_msg[1];
   packed_msg = GNUNET_malloc(packed_msg_len);
-  memcpy(packed_msg, &received_msg[1 + sender_address_len], packed_msg_len);
+  memcpy(packed_msg, &packed_msg_start[sender_address_len], packed_msg_len);
 
+#if DEBUG_DV
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "packed message type: %d or %d\n", 
ntohs(((struct GNUNET_MessageHeader *)packed_msg)->type), ((struct 
GNUNET_MessageHeader *)packed_msg)->type);
+#endif
   handle->receive_handler(handle->receive_cls,
                           &received_msg->sender,
                           packed_msg,
@@ -348,19 +360,23 @@
                     size_t addrlen)
 {
   struct GNUNET_DV_SendMessage *msg;
-
-  msg = GNUNET_malloc(sizeof(struct GNUNET_DV_SendMessage) + msgbuf_size + 
addrlen);
-  msg->header.size = htons(sizeof(struct GNUNET_DV_SendMessage) + msgbuf_size 
+ addrlen);
+  char *end_of_message;
+  /* FIXME: Copy message to end of thingy, can't just allocate dummy! */
+#if DEBUG_DV
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV SEND called with message of size %d, 
address size %d, total size to send is %d\n", msgbuf_size, addrlen, 
sizeof(struct GNUNET_DV_SendMessage) + msgbuf_size + addrlen);
+#endif
+  msg = GNUNET_malloc(sizeof(struct GNUNET_DV_SendMessage) + addrlen + 
msgbuf_size);
+  msg->header.size = htons(sizeof(struct GNUNET_DV_SendMessage) + addrlen + 
msgbuf_size);
   msg->header.type = htons(GNUNET_MESSAGE_TYPE_TRANSPORT_DV_SEND);
   memcpy(&msg->target, target, sizeof(struct GNUNET_PeerIdentity));
-  msg->msgbuf = GNUNET_malloc(msgbuf_size);
-  memcpy(msg->msgbuf, msgbuf, msgbuf_size);
   msg->msgbuf_size = htons(msgbuf_size);
   msg->priority = htonl(priority);
   msg->timeout = timeout;
   msg->addrlen = htons(addrlen);
   memcpy(&msg[1], addr, addrlen);
-
+  end_of_message = (char *)&msg[1];
+  end_of_message = &end_of_message[addrlen];
+  memcpy(end_of_message, msgbuf, msgbuf_size);
   add_pending(dv_handle, msg);
 
   return GNUNET_OK;

Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c   2010-04-03 10:38:02 UTC (rev 10767)
+++ gnunet/src/dv/gnunet-service-dv.c   2010-04-03 14:27:50 UTC (rev 10768)
@@ -287,7 +287,7 @@
   /**
    * PublicKey of neighbor.
    */
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey;
+  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pkey;
 
   /**
    * Last time we received routing information from this peer
@@ -466,22 +466,57 @@
                     size_t cost)
 {
   struct GNUNET_DV_MessageReceived *received_msg;
+#if DEBUG_DV
+  struct GNUNET_MessageHeader * packed_message_header;
+  struct GNUNET_HELLO_Message *hello_msg;
+  struct GNUNET_PeerIdentity hello_identity;
+#endif
+  char *sender_address;
+  size_t sender_address_len;
+  char *packed_msg_start;
   int size;
 
-  size = sizeof(struct GNUNET_DV_MessageReceived) + sizeof(struct 
GNUNET_PeerIdentity) + message_size;
+  if (memcmp(sender, distant_neighbor, sizeof(struct GNUNET_PeerIdentity)) != 
0)
+  {
+    sender_address_len = sizeof(struct GNUNET_PeerIdentity) * 2;
+    sender_address = GNUNET_malloc(sender_address_len);
+    memcpy(sender_address, distant_neighbor, sizeof(struct 
GNUNET_PeerIdentity));
+    memcpy(&sender_address[sizeof(struct GNUNET_PeerIdentity)], sender, 
sizeof(struct GNUNET_PeerIdentity));
+  }
+  else
+  {
+    sender_address_len = sizeof(struct GNUNET_PeerIdentity);
+    sender_address = GNUNET_malloc(sender_address_len);
+    memcpy(sender_address, sender, sizeof(struct GNUNET_PeerIdentity));
+  }
+
+  size = sizeof(struct GNUNET_DV_MessageReceived) + sender_address_len + 
message_size;
   received_msg = GNUNET_malloc(size);
   received_msg->header.size = htons(size);
   received_msg->header.type = htons(GNUNET_MESSAGE_TYPE_TRANSPORT_DV_RECEIVE);
-  received_msg->sender_address_len = htons(sizeof(struct GNUNET_PeerIdentity));
+  received_msg->sender_address_len = htons(sender_address_len);
   received_msg->distance = htonl(cost);
   received_msg->msg_len = htons(message_size);
   /* Set the sender in this message to be the original sender! */
   memcpy(&received_msg->sender, &distant_neighbor, sizeof(struct 
GNUNET_PeerIdentity));
   /* Copy the intermediate sender to the end of the message, this is how the 
transport identifies this peer */
-  memcpy(&received_msg[1], sender, sizeof(struct GNUNET_PeerIdentity));
+  memcpy(&received_msg[1], sender_address, sender_address_len);
+  GNUNET_free(sender_address);
   /* Copy the actual message after the sender */
-  memcpy(&received_msg[1 + sizeof(struct GNUNET_PeerIdentity)], message, 
message_size);
-
+  packed_msg_start = (char *)&received_msg[1];
+  packed_msg_start = &packed_msg_start[sender_address_len];
+  memcpy(packed_msg_start, message, message_size);
+#if DEBUG_DV
+  packed_message_header = (struct GNUNET_MessageHeader *)packed_msg_start;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "dv service created received message. 
sender_address_len %lu, packed message len %d, total len %d\n", 
sender_address_len, ntohs(received_msg->msg_len), 
ntohs(received_msg->header.size));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "dv packed message len %d, type %d\n", 
ntohs(packed_message_header->size), ntohs(packed_message_header->type));
+  if (ntohs(packed_message_header->type) == GNUNET_MESSAGE_TYPE_HELLO)
+  {
+    hello_msg = (struct GNUNET_HELLO_Message *)packed_message_header;
+    GNUNET_HELLO_get_id(hello_msg, &hello_identity);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Packed HELLO message is about peer 
%s\n", GNUNET_i2s(&hello_identity));
+  }
+#endif
   if (client_handle != NULL)
     {
       GNUNET_SERVER_notify_transmit_ready (client_handle,
@@ -732,6 +767,7 @@
               GNUNET_i2s(&my_identity));
   char * encPeerAbout;
   char * encPeerTo;
+  struct GNUNET_PeerIdentity about_peer_id;
 #endif
   struct DistantNeighbor *about;
   struct DirectNeighbor *to;
@@ -771,7 +807,8 @@
 #endif
       (to != NULL) &&
       (0 != memcmp (&about->identity,
-                        &to->identity, sizeof (struct GNUNET_PeerIdentity))))
+                        &to->identity, sizeof (struct GNUNET_PeerIdentity))) &&
+      (about->pkey != NULL))
     {
 #if DEBUG_DV
       encPeerAbout = GNUNET_strdup(GNUNET_i2s(&about->identity));
@@ -791,10 +828,18 @@
       message->cost = htonl (about->cost);
       message->neighbor_id = htonl (about->our_id);
 
-      memcpy (&message->pkey, &about->pkey, sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
+      memcpy (&message->pkey, about->pkey, sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
       memcpy (&message->neighbor,
               &about->identity, sizeof (struct GNUNET_PeerIdentity));
 
+#if DEBUG_DV
+      GNUNET_CRYPTO_hash (about->pkey,
+                          sizeof (struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+                          &about_peer_id.hashPubKey);
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer id from message %s\n", 
GNUNET_i2s(&about->identity));
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer id from pubkey  %s\n", 
GNUNET_i2s(&about_peer_id));
+#endif
+
       pending_message->msg_size = sizeof(p2p_dv_MESSAGE_NeighborInfo);
       pending_message->transmit_handle = 
GNUNET_CORE_notify_transmit_ready(coreAPI, default_dv_priority, 
default_dv_delay, &to->identity, sizeof(p2p_dv_MESSAGE_NeighborInfo), 
&core_transmit_notify, pending_message);
 
@@ -809,7 +854,7 @@
                                 ctx.send_interval);*/
     }
 
-  GNUNET_SCHEDULER_add_delayed(sched, send_context->timeout, 
&neighbor_send_task, send_context);
+  send_context->task = GNUNET_SCHEDULER_add_delayed(sched, 
send_context->timeout, &neighbor_send_task, send_context);
   return;
 }
 
@@ -835,6 +880,7 @@
 
   client_handle = client;
 
+  GNUNET_SERVER_client_keep(client_handle);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }
 
@@ -853,7 +899,7 @@
 {
 #if DEBUG_DV
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "%s: Receives %s message!\n", "dv", "SEND");
+              "%s: Receives %s message!\n\n\n", "dv", "SEND");
 #endif
   if (client_handle == NULL)
   {
@@ -897,9 +943,23 @@
 };
 
 
+#if DEBUG_DV
+static void handle_any(void *cls,
+                       struct GNUNET_SERVER_Client * client,
+                       const struct GNUNET_MessageHeader * message)
+{
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "\n\n\n\n\n\nDV service receives message 
of type %d, size %d\n\n\n\n\n\n", ntohs(message->type), ntohs(message->size));
+  GNUNET_SERVER_receive_done (client, GNUNET_OK);
+}
+#endif
+
+
 static struct GNUNET_SERVER_MessageHandler plugin_handlers[] = {
   {&send_dv_message, NULL, GNUNET_MESSAGE_TYPE_TRANSPORT_DV_SEND, 0},
   {&handle_start, NULL, GNUNET_MESSAGE_TYPE_DV_START, 0},
+#if DEBUG_DV
+  {&handle_any, NULL, GNUNET_MESSAGE_TYPE_ALL, 0},
+#endif
   {NULL, NULL, 0, 0}
 };
 
@@ -940,7 +1000,43 @@
   coreAPI = server;
 }
 
+/**
+ * Iterator over hash map entries.
+ *
+ * @param cls closure
+ * @param key current key code
+ * @param value value in the hash map
+ * @return GNUNET_YES if we should continue to
+ *         iterate,
+ *         GNUNET_NO if not.
+ */
+static int add_pkey_to_extended (void *cls,
+                                 const GNUNET_HashCode * key,
+                                 void *value)
+{
+  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pkey = cls;
+  struct DistantNeighbor *distant_neighbor = value;
+#if DEBUG_DV
+  struct GNUNET_PeerIdentity about_peer_id;
+#endif
 
+  if (distant_neighbor->pkey == NULL)
+  {
+    distant_neighbor->pkey = GNUNET_malloc(sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
+    memcpy(distant_neighbor->pkey, pkey, sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
+#if DEBUG_DV
+    GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Updating pkey for extended list for 
peer %s\n", GNUNET_i2s(&distant_neighbor->identity));
+    GNUNET_CRYPTO_hash (distant_neighbor->pkey,
+                        sizeof (struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+                        &about_peer_id.hashPubKey);
+    GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer id from setup %s\n", 
GNUNET_i2s(&distant_neighbor->identity));
+    GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer id from pkey  %s\n", 
GNUNET_i2s(&about_peer_id));
+#endif
+  }
+
+  return GNUNET_YES;
+}
+
 /**
  * Iterator over hash map entries.
  *
@@ -1074,7 +1170,13 @@
       neighbor->referrer = referrer;
       memcpy (&neighbor->identity, peer, sizeof (struct GNUNET_PeerIdentity));
       if (pkey != NULL) /* pkey will be null on direct neighbor addition */
-        memcpy (&neighbor->pkey, pkey, sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
+      {
+        neighbor->pkey = GNUNET_malloc(sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
+        memcpy (neighbor->pkey, pkey, sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
+      }
+      else
+        neighbor->pkey = pkey;
+
       neighbor->last_activity = now;
       neighbor->cost = cost;
       neighbor->referrer_id = referrer_peer_id;
@@ -1132,7 +1234,6 @@
 
   /* Hello "address" will be concatenation of distant peer and direct peer 
identities */
   size = 2 * sizeof(struct GNUNET_PeerIdentity);
-  fprintf(stdout, "size is %lu, max is %lu\n", size, max);
   GNUNET_assert(max >= size);
 
   addr_buffer = GNUNET_malloc(size);
@@ -1174,6 +1275,7 @@
 {
   struct HelloContext *hello_context;
   struct GNUNET_HELLO_Message *hello_msg;
+  struct GNUNET_MessageHeader *hello_hdr;
   struct DirectNeighbor *referrer;
   p2p_dv_MESSAGE_NeighborInfo *enc_message = (p2p_dv_MESSAGE_NeighborInfo 
*)message;
 
@@ -1209,12 +1311,13 @@
   hello_context->addresses_to_add = 1;
   hello_msg = GNUNET_HELLO_create(&enc_message->pkey, &generate_hello_address, 
hello_context);
 
+  hello_hdr = GNUNET_HELLO_get_header(hello_msg);
 #if DEBUG_DV
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "%s: Sending %s message to plugin!\n", "dv", "HELLO");
+              "%s: Sending %s message to plugin, type is %d, size %d!\n", 
"dv", "HELLO", ntohs(hello_hdr->type), ntohs(hello_hdr->size));
 #endif
 
-  send_to_plugin(&enc_message->neighbor, GNUNET_HELLO_get_header(hello_msg), 
GNUNET_HELLO_size(hello_msg), hello_context->distant_peer, 
ntohl(enc_message->cost) + 1);
+  send_to_plugin(hello_context->direct_peer, 
GNUNET_HELLO_get_header(hello_msg), GNUNET_HELLO_size(hello_msg), 
hello_context->distant_peer, ntohl(enc_message->cost) + 1);
   return GNUNET_OK;
 }
 
@@ -1227,6 +1330,7 @@
   struct DirectNeighbor *neighbor = peerinfo_iterator->neighbor;
 
 #if DEBUG_DV
+  struct GNUNET_PeerIdentity about_peer_id;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "%s: process_peerinfo called!\n", "dv");
 #endif
@@ -1242,6 +1346,18 @@
 
   if ((hello != NULL) && (GNUNET_HELLO_get_key (hello, &neighbor->pkey) == 
GNUNET_OK))
     {
+#if DEBUG_DV
+      GNUNET_CRYPTO_hash (&neighbor->pkey,
+                          sizeof (struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+                          &about_peer_id.hashPubKey);
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "(peerinfo) Peer id from setup 
%s\n", GNUNET_i2s(&neighbor->identity));
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "(peerinfo) Peer id from hello 
%s\n", GNUNET_i2s(&about_peer_id));
+#endif
+
+      GNUNET_CONTAINER_multihashmap_get_multiple(ctx.extended_neighbors,
+                                                 &peer->hashPubKey,
+                                                 &add_pkey_to_extended,
+                                                 &neighbor->pkey);
       neighbor->send_context->task = GNUNET_SCHEDULER_add_now(sched, 
&neighbor_send_task, neighbor->send_context);
     }
 }
@@ -1303,7 +1419,7 @@
 }
 
 /**
- * Method called whenever a given peer either connects.
+ * Method called whenever a given peer disconnects.
  *
  * @param cls closure
  * @param peer peer identity this notification is about

Modified: gnunet/src/dv/plugin_transport_dv.c
===================================================================
--- gnunet/src/dv/plugin_transport_dv.c 2010-04-03 10:38:02 UTC (rev 10767)
+++ gnunet/src/dv/plugin_transport_dv.c 2010-04-03 14:27:50 UTC (rev 10768)
@@ -183,7 +183,7 @@
                    "plugin_transport_dv",
                    _("Received message from %s of type %d!\n"),
                    "DV SERVICE", ntohs(((struct GNUNET_MessageHeader 
*)msg)->type));
-  plugin->env->receive(plugin,
+  plugin->env->receive(plugin->env->cls,
                        sender,
                        (struct GNUNET_MessageHeader *)msg,
                        distance,
@@ -242,6 +242,9 @@
   /* FIXME: do we want the dv plugin to remember sent messages to call 
continuation once message actually goes out?
    * Or do we just call the continuation once we've notified the plugin?
    */
+#if DEBUG_DV
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV API: Received send request from 
transport, calling GNUNET_DV_send\n");
+#endif
   ret = GNUNET_DV_send(plugin->dv_handle,
                        target,
                        msgbuf,
@@ -250,12 +253,11 @@
                        timeout,
                        addr,
                        addrlen);
-  /*, cont, cont_cls);*/
 
   if (ret == 0)
-    cont(cls, target, GNUNET_OK);
+    cont(cont_cls, target, GNUNET_OK);
   else
-    cont(cls, target, GNUNET_SYSERR);
+    cont(cont_cls, target, GNUNET_SYSERR);
 
   return ret;
 }
@@ -343,45 +345,7 @@
   struct GNUNET_TRANSPORT_PluginEnvironment *env = cls;
   struct GNUNET_TRANSPORT_PluginFunctions *api;
   struct Plugin *plugin;
-  /*struct GNUNET_SERVICE_Context *service;*/
 
-  /**
-   * Do we not even need a service for this thing?  That's peculiar.
-   */
-  /*
-  service = GNUNET_SERVICE_start ("transport-dv", env->sched, env->cfg);
-  if (service == NULL)
-    {
-      GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING,
-                       "dv",
-                       _
-                       ("Failed to start service for `%s' transport 
plugin.\n"),
-                       "dv");
-      return NULL;
-    }
-   */
-  /**
-   * I don't think we need a port, the only way we get stuff is being directly
-   * called by service transport or by responses from the dv-service via our
-   * client handle
-   */
-  /*
-  if ((GNUNET_OK !=
-       GNUNET_CONFIGURATION_get_value_number (env->cfg,
-                                              "transport-dv",
-                                              "PORT",
-                                              &port)))
-    {
-      GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
-                       "dv",
-                       _
-                       ("Require valid port number for service `%s' in 
configuration!\n"),
-                       "transport-dv");
-      GNUNET_SERVICE_stop (service);
-      return NULL;
-    }
-    */
-
   plugin = GNUNET_malloc (sizeof (struct Plugin));
   plugin->env = env;
   plugin->statistics = NULL;

Modified: gnunet/src/dv/test_transport_api_dv.c
===================================================================
--- gnunet/src/dv/test_transport_api_dv.c       2010-04-03 10:38:02 UTC (rev 
10767)
+++ gnunet/src/dv/test_transport_api_dv.c       2010-04-03 14:27:50 UTC (rev 
10768)
@@ -287,7 +287,7 @@
   sched = s;
 
   die_task = GNUNET_SCHEDULER_add_delayed (sched,
-      GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 1), &end_badly, 
NULL);
+      GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5), &end_badly, 
NULL);
 
   setup_peer (&p1, "test_transport_api_dv_peer1.conf");
   setup_peer (&p2, "test_transport_api_dv_peer2.conf");

Modified: gnunet/src/dv/test_transport_api_dv_peer1.conf
===================================================================
--- gnunet/src/dv/test_transport_api_dv_peer1.conf      2010-04-03 10:38:02 UTC 
(rev 10767)
+++ gnunet/src/dv/test_transport_api_dv_peer1.conf      2010-04-03 14:27:50 UTC 
(rev 10768)
@@ -49,6 +49,7 @@
 DEBUG = NO
 #PREFIX = xterm -T transport2 -e gdb --command=cmd --args
 #PREFIX = valgrind --leak-check=full
+#BINARY = 
/root/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
@@ -92,13 +93,14 @@
 PORT = 12367
 
 [dv]
-DEBUG = YES
+DEBUG = NO
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
 BINARY = gnunet-service-dv
-BINARY = 
/home/mrwiggles/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv
-PREFIX = xterm -T dvservice -e gdb --args
+#BINARY = 
/root/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv
+#PREFIX = xterm -T dvservice -e gdb --args
+#PREFIX = valgrind --log-file=dv-%p --leak-check=full
 CONFIG = $DEFAULTCONFIG
 HOME = $SERVICEHOME
 HOSTNAME = localhost
@@ -117,7 +119,7 @@
 PORT = 12092
 
 [arm]
-DEFAULTSERVICES = core dv
+DEFAULTSERVICES = core dv statistics
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;

Modified: gnunet/src/dv/test_transport_api_dv_peer2.conf
===================================================================
--- gnunet/src/dv/test_transport_api_dv_peer2.conf      2010-04-03 10:38:02 UTC 
(rev 10767)
+++ gnunet/src/dv/test_transport_api_dv_peer2.conf      2010-04-03 14:27:50 UTC 
(rev 10768)
@@ -105,18 +105,20 @@
 PORT = 22367
 
 [dv]
-DEBUG = YES
+DEBUG = NO
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
 BINARY = gnunet-service-dv
+#BINARY = 
/root/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv
+#PREFIX = xterm -T dvservice -e gdb --args
 CONFIG = $DEFAULTCONFIG
 HOME = $SERVICEHOME
 HOSTNAME = localhost
 PORT = 22370
 
 [arm]
-DEFAULTSERVICES = core dv
+DEFAULTSERVICES = core dv statistics
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;

Modified: gnunet/src/dv/test_transport_api_dv_peer3.conf
===================================================================
--- gnunet/src/dv/test_transport_api_dv_peer3.conf      2010-04-03 10:38:02 UTC 
(rev 10767)
+++ gnunet/src/dv/test_transport_api_dv_peer3.conf      2010-04-03 14:27:50 UTC 
(rev 10768)
@@ -46,18 +46,18 @@
 
 [transport]
 PLUGINS = tcp dv
-DEBUG = YES
-# PREFIX = 
+DEBUG = NO 
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
 NEIGHBOUR_LIMIT = 50
-BINARY = 
/home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
+#BINARY = 
/root/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
+BINARY = gnunet-service-transport
 CONFIG = $DEFAULTCONFIG
 HOME = $SERVICEHOME
 HOSTNAME = localhost
 PORT = 32365
-PREFIX = xterm -T transport1 -e gdb --command=cmd --args
+#PREFIX = xterm -T transport1 -e gdb --command=cmd --args
 #PREFIX = valgrind --leak-check=full
 
 [peerinfo]
@@ -105,7 +105,7 @@
 PORT = 32367
 
 [dv]
-DEBUG = YES
+DEBUG = NO
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
@@ -116,7 +116,7 @@
 PORT = 32370
 
 [arm]
-DEFAULTSERVICES = core dv
+DEFAULTSERVICES = core dv statistics
 ALLOW_SHUTDOWN = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;





reply via email to

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