gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10050 - in gnunet: . src/core src/include src/topology src


From: gnunet
Subject: [GNUnet-SVN] r10050 - in gnunet: . src/core src/include src/topology src/util
Date: Mon, 18 Jan 2010 17:00:03 +0100

Author: grothoff
Date: 2010-01-18 17:00:03 +0100 (Mon, 18 Jan 2010)
New Revision: 10050

Modified:
   gnunet/TODO
   gnunet/src/core/core_api_peer_get_info.c
   gnunet/src/include/gnunet_core_service.h
   gnunet/src/topology/gnunet-daemon-topology.c
   gnunet/src/util/container_meta_data.c
   gnunet/src/util/test_container_heap.c
   gnunet/src/util/test_container_meta_data.c
Log:
misc fixes

Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2010-01-18 14:26:57 UTC (rev 10049)
+++ gnunet/TODO 2010-01-18 16:00:03 UTC (rev 10050)
@@ -67,6 +67,8 @@
 * ARM:
   - need to get rid of synchronous API for service starts (cause all kinds of 
problems)
     [=> eliminate for need to tell ARM about service starts most of the time!]
+* HELLO:
+  - need function to test "equivalency" of HELLOs; use in topology!
 * Module features to implement:
   - advanced FS API parts
     + namespaces: fundamental namespace API

Modified: gnunet/src/core/core_api_peer_get_info.c
===================================================================
--- gnunet/src/core/core_api_peer_get_info.c    2010-01-18 14:26:57 UTC (rev 
10049)
+++ gnunet/src/core/core_api_peer_get_info.c    2010-01-18 16:00:03 UTC (rev 
10050)
@@ -64,7 +64,7 @@
 
   if (msg == NULL)
     {
-      if (irc != NULL)
+      if (irc->info != NULL)
        irc->info (irc->info_cls, 
                   NULL, 0, 0, GNUNET_TIME_UNIT_FOREVER_REL, 0, 0);     
       GNUNET_CLIENT_disconnect (irc->client);
@@ -75,7 +75,7 @@
        (ntohs (msg->size) != sizeof (struct ConfigurationInfoMessage)) )
     {
       GNUNET_break (0);
-      if (irc != NULL)
+      if (irc->info != NULL)
        irc->info (irc->info_cls, 
                   NULL, 0, 0, GNUNET_TIME_UNIT_FOREVER_REL, 0, 0);     
       GNUNET_CLIENT_disconnect (irc->client);
@@ -83,7 +83,7 @@
       return;
     }
   cim = (const struct ConfigurationInfoMessage*) msg;
-  if (irc != NULL)
+  if (irc->info != NULL)
     irc->info (irc->info_cls,
               &cim->peer,
               ntohl (cim->bpm_in),

Modified: gnunet/src/include/gnunet_core_service.h
===================================================================
--- gnunet/src/include/gnunet_core_service.h    2010-01-18 14:26:57 UTC (rev 
10049)
+++ gnunet/src/include/gnunet_core_service.h    2010-01-18 16:00:03 UTC (rev 
10050)
@@ -175,8 +175,10 @@
 void GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle);
 
 
+// FIXME
 struct GNUNET_CORE_PeerRequestHandle;
 
+// FIXME
 struct GNUNET_CORE_PeerRequestHandle *
 GNUNET_CORE_peer_request_connect (struct GNUNET_SCHEDULER_Handle *sched,
                                         const struct 
GNUNET_CONFIGURATION_Handle *cfg,
@@ -185,6 +187,7 @@
                                         void *cont_cls);
 
 
+// FIXME
 struct GNUNET_CORE_PeerRequestHandle *
 GNUNET_CORE_peer_request_disconnect (struct GNUNET_SCHEDULER_Handle *sched,
                                            const struct 
GNUNET_CONFIGURATION_Handle *cfg,
@@ -192,6 +195,7 @@
                                            GNUNET_SCHEDULER_Task cont,
                                            void *cont_cls);
 
+// FIXME
 void
 GNUNET_CORE_peer_request_cancel (struct GNUNET_CORE_PeerRequestHandle *req);
 

Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c        2010-01-18 14:26:57 UTC 
(rev 10049)
+++ gnunet/src/topology/gnunet-daemon-topology.c        2010-01-18 16:00:03 UTC 
(rev 10050)
@@ -856,7 +856,6 @@
   if (hello == NULL)
     {
       /* free existing HELLO, if any */
-      pos = find_peer (peer);
       if (NULL != (pos = find_peer (peer)))
        {
          GNUNET_free_non_null (pos->hello);
@@ -1063,11 +1062,9 @@
          fl = make_peer (&pid,
                          NULL,
                          GNUNET_YES);
-#if DEBUG_TOPOLOGY
-         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                     "Found friend `%s' in configuration\n",
+         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                     _("Found friend `%s' in configuration\n"),
                      GNUNET_i2s (&fl->id));
-#endif       
        }
       pos = pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded);
       while ((pos < frstat.st_size) && isspace (data[pos]))

Modified: gnunet/src/util/container_meta_data.c
===================================================================
--- gnunet/src/util/container_meta_data.c       2010-01-18 14:26:57 UTC (rev 
10049)
+++ gnunet/src/util/container_meta_data.c       2010-01-18 16:00:03 UTC (rev 
10050)
@@ -519,7 +519,8 @@
        }
       pos = pos->next;
     }
-  if (match == NULL)
+  if ( (match == NULL) ||
+       (match->data_size == 0) )
     return 0;
   *thumb = GNUNET_malloc (match->data_size);
   memcpy (*thumb, match->data, match->data_size);
@@ -855,9 +856,11 @@
       off -= pos->data_size;
       memcpy (&mdata[off], pos->data, pos->data_size);
       off -= plen;
-      memcpy (&mdata[off], pos->plugin_name, plen);
+      if (pos->plugin_name != NULL)
+       memcpy (&mdata[off], pos->plugin_name, plen);
       off -= mlen;
-      memcpy (&mdata[off], pos->mime_type, mlen);      
+      if (pos->mime_type != NULL)
+       memcpy (&mdata[off], pos->mime_type, mlen);      
       i++;
       pos = pos->next;
     }  
@@ -866,6 +869,7 @@
   clen = 0;
   cdata = NULL;
   left = size;
+  pos = md->items;
   for (i=0;i<md->item_count;i++)
     {           
       comp = GNUNET_NO;
@@ -887,6 +891,7 @@
          hdr->entries = htonl (md->item_count);
          if (GNUNET_YES == comp)
            {
+             GNUNET_assert (clen < left);
              hdr->version = htonl (2 | HEADER_COMPRESSED);
              memcpy (&hdr[1],
                      cdata, 
@@ -960,7 +965,8 @@
       if (pos->plugin_name != NULL)
        left -= strlen (pos->plugin_name) + 1;
       if (pos->mime_type != NULL)
-       left -= strlen (pos->mime_type) + 1;      
+       left -= strlen (pos->mime_type) + 1;
+      pos = pos->next;
     }
   GNUNET_free (ent);
 

Modified: gnunet/src/util/test_container_heap.c
===================================================================
--- gnunet/src/util/test_container_heap.c       2010-01-18 14:26:57 UTC (rev 
10049)
+++ gnunet/src/util/test_container_heap.c       2010-01-18 16:00:03 UTC (rev 
10050)
@@ -51,6 +51,7 @@
 
   myHeap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
   n1 = GNUNET_CONTAINER_heap_insert (myHeap, "11", 11);
+  GNUNET_assert (NULL != n1);
   GNUNET_CONTAINER_heap_iterate (myHeap, &iterator_callback, NULL);
   GNUNET_assert (1 == GNUNET_CONTAINER_heap_get_size (myHeap));
   n2 = GNUNET_CONTAINER_heap_insert (myHeap, "78", 78);
@@ -66,6 +67,7 @@
   GNUNET_CONTAINER_heap_iterate (myHeap, &iterator_callback, NULL);
 
   n4 = GNUNET_CONTAINER_heap_insert (myHeap, "50", 50);
+  GNUNET_CONTAINER_heap_update_cost (myHeap, n4, 0);
   GNUNET_assert (3 == GNUNET_CONTAINER_heap_get_size (myHeap));
   GNUNET_CONTAINER_heap_iterate (myHeap, &iterator_callback, NULL);
 

Modified: gnunet/src/util/test_container_meta_data.c
===================================================================
--- gnunet/src/util/test_container_meta_data.c  2010-01-18 14:26:57 UTC (rev 
10049)
+++ gnunet/src/util/test_container_meta_data.c  2010-01-18 16:00:03 UTC (rev 
10050)
@@ -262,6 +262,7 @@
   EXTRACTOR_plugin_remove_all (ex);
   d = GNUNET_CONTAINER_meta_data_duplicate (m);
   GNUNET_CONTAINER_meta_data_destroy (m);
+  thumb = NULL;
   size = GNUNET_CONTAINER_meta_data_get_thumbnail (d, &thumb);
   if (size == 0)
     {





reply via email to

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