aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-07 23:42:28 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-07 23:42:28 +0000
commitbfa8316970a7dce659585a038458bc41776ed965 (patch)
treed6c23c6731fe3b8ae2f5206fe7172be9b4db1f10 /src
parent6e659b41e60f82e0a5d419f2c5c818a340b0917c (diff)
downloadgnunet-bfa8316970a7dce659585a038458bc41776ed965.tar.gz
gnunet-bfa8316970a7dce659585a038458bc41776ed965.zip
stuff
Diffstat (limited to 'src')
-rw-r--r--src/datastore/Makefile.am1
-rw-r--r--src/datastore/gnunet-service-datastore.c4
-rw-r--r--src/fs/fs.c4
-rw-r--r--src/fs/fs_publish.c3
-rw-r--r--src/fs/fs_search.c3
-rw-r--r--src/fs/test_fs_publish_persistence.c14
-rw-r--r--src/fs/test_fs_unindex.c7
-rw-r--r--src/fs/test_fs_unindex_persistence.c7
-rw-r--r--src/statistics/statistics_api.c5
-rw-r--r--src/util/connection.c11
10 files changed, 39 insertions, 20 deletions
diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am
index e572eafd0..a3882d676 100644
--- a/src/datastore/Makefile.am
+++ b/src/datastore/Makefile.am
@@ -32,7 +32,6 @@ bin_PROGRAMS = \
32gnunet_service_datastore_SOURCES = \ 32gnunet_service_datastore_SOURCES = \
33 gnunet-service-datastore.c plugin_datastore.h 33 gnunet-service-datastore.c plugin_datastore.h
34gnunet_service_datastore_LDADD = \ 34gnunet_service_datastore_LDADD = \
35 $(top_builddir)/src/arm/libgnunetarm.la \
36 $(top_builddir)/src/statistics/libgnunetstatistics.la \ 35 $(top_builddir)/src/statistics/libgnunetstatistics.la \
37 $(top_builddir)/src/util/libgnunetutil.la \ 36 $(top_builddir)/src/util/libgnunetutil.la \
38 $(GN_LIBINTL) 37 $(GN_LIBINTL)
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 6d0f29671..fc0587cf7 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -26,7 +26,6 @@
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_arm_service.h"
30#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
31#include "gnunet_statistics_service.h" 30#include "gnunet_statistics_service.h"
32#include "plugin_datastore.h" 31#include "plugin_datastore.h"
@@ -1304,7 +1303,6 @@ unload_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1304 GNUNET_CONTAINER_bloomfilter_free (filter); 1303 GNUNET_CONTAINER_bloomfilter_free (filter);
1305 filter = NULL; 1304 filter = NULL;
1306 } 1305 }
1307 GNUNET_ARM_stop_services (cfg, tc->sched, "statistics", NULL);
1308 if (stats != NULL) 1306 if (stats != NULL)
1309 { 1307 {
1310 GNUNET_STATISTICS_destroy (stats, GNUNET_YES); 1308 GNUNET_STATISTICS_destroy (stats, GNUNET_YES);
@@ -1453,13 +1451,11 @@ run (void *cls,
1453 } 1451 }
1454 return; 1452 return;
1455 } 1453 }
1456 GNUNET_ARM_start_services (cfg, sched, "statistics", NULL);
1457 plugin = load_plugin (); 1454 plugin = load_plugin ();
1458 if (NULL == plugin) 1455 if (NULL == plugin)
1459 { 1456 {
1460 GNUNET_CONTAINER_bloomfilter_free (filter); 1457 GNUNET_CONTAINER_bloomfilter_free (filter);
1461 filter = NULL; 1458 filter = NULL;
1462 GNUNET_ARM_stop_services (cfg, sched, "statistics", NULL);
1463 if (stats != NULL) 1459 if (stats != NULL)
1464 { 1460 {
1465 GNUNET_STATISTICS_destroy (stats, GNUNET_YES); 1461 GNUNET_STATISTICS_destroy (stats, GNUNET_YES);
diff --git a/src/fs/fs.c b/src/fs/fs.c
index d2ac711f2..34850f14c 100644
--- a/src/fs/fs.c
+++ b/src/fs/fs.c
@@ -880,6 +880,7 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h,
880 ret->data.file.reader_cls = GNUNET_FS_make_file_reader_context_ (ret->filename); 880 ret->data.file.reader_cls = GNUNET_FS_make_file_reader_context_ (ret->filename);
881 break; 881 break;
882 case 4: /* directory */ 882 case 4: /* directory */
883 ret->is_directory = GNUNET_YES;
883 if ( (GNUNET_OK != 884 if ( (GNUNET_OK !=
884 GNUNET_BIO_read_int32 (rh, &dsize)) || 885 GNUNET_BIO_read_int32 (rh, &dsize)) ||
885 (NULL == (ret->data.dir.dir_data = GNUNET_malloc_large (dsize))) || 886 (NULL == (ret->data.dir.dir_data = GNUNET_malloc_large (dsize))) ||
@@ -892,7 +893,6 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h,
892 goto cleanup; 893 goto cleanup;
893 } 894 }
894 ret->data.dir.dir_size = (uint32_t) dsize; 895 ret->data.dir.dir_size = (uint32_t) dsize;
895 ret->is_directory = GNUNET_YES;
896 if (filename != NULL) 896 if (filename != NULL)
897 { 897 {
898 ret->data.dir.entries = deserialize_file_information (h, filename); 898 ret->data.dir.entries = deserialize_file_information (h, filename);
@@ -1451,6 +1451,8 @@ deserialize_publish_file (void *cls,
1451 pc->fi_pos = pc->fi; 1451 pc->fi_pos = pc->fi;
1452 } 1452 }
1453 } 1453 }
1454 GNUNET_free (fi_root);
1455 fi_root = NULL;
1454 /* generate RESUME event(s) */ 1456 /* generate RESUME event(s) */
1455 GNUNET_FS_file_information_inspect (pc->fi, 1457 GNUNET_FS_file_information_inspect (pc->fi,
1456 &fip_signal_resume, 1458 &fip_signal_resume,
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 6d3f4679d..be2994176 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -149,6 +149,7 @@ ds_put_cont (void *cls,
149 /* we were aborted in the meantime, 149 /* we were aborted in the meantime,
150 finish shutdown! */ 150 finish shutdown! */
151 publish_cleanup (pcc->sc); 151 publish_cleanup (pcc->sc);
152 GNUNET_free (pcc);
152 return; 153 return;
153 } 154 }
154 GNUNET_assert (GNUNET_YES == pcc->sc->in_network_wait); 155 GNUNET_assert (GNUNET_YES == pcc->sc->in_network_wait);
@@ -1587,6 +1588,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
1587 memcpy (dest, update, nidlen); 1588 memcpy (dest, update, nidlen);
1588 dest += nidlen; 1589 dest += nidlen;
1589 memcpy (dest, uris, slen); 1590 memcpy (dest, uris, slen);
1591 GNUNET_free (uris);
1590 dest += slen; 1592 dest += slen;
1591 mdsize = GNUNET_CONTAINER_meta_data_serialize (mmeta, 1593 mdsize = GNUNET_CONTAINER_meta_data_serialize (mmeta,
1592 &dest, 1594 &dest,
@@ -1596,7 +1598,6 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
1596 if (mdsize == -1) 1598 if (mdsize == -1)
1597 { 1599 {
1598 GNUNET_break (0); 1600 GNUNET_break (0);
1599 GNUNET_free (uris);
1600 GNUNET_free (sb); 1601 GNUNET_free (sb);
1601 cont (cont_cls, 1602 cont (cont_cls,
1602 NULL, 1603 NULL,
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 171eebf4b..af405bfc0 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -529,6 +529,7 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc,
529 sc->options, 529 sc->options,
530 NULL, 530 NULL,
531 sr); 531 sr);
532 GNUNET_free (uu.data.sks.identifier);
532} 533}
533 534
534 535
@@ -1308,6 +1309,7 @@ GNUNET_FS_search_signal_suspend_ (void *cls)
1308 GNUNET_free_non_null (sc->requests); 1309 GNUNET_free_non_null (sc->requests);
1309 GNUNET_free_non_null (sc->emsg); 1310 GNUNET_free_non_null (sc->emsg);
1310 GNUNET_FS_uri_destroy (sc->uri); 1311 GNUNET_FS_uri_destroy (sc->uri);
1312 GNUNET_free_non_null (sc->serialization);
1311 GNUNET_free (sc); 1313 GNUNET_free (sc);
1312} 1314}
1313 1315
@@ -1474,6 +1476,7 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc)
1474 ? GNUNET_FS_SYNC_PATH_CHILD_SEARCH 1476 ? GNUNET_FS_SYNC_PATH_CHILD_SEARCH
1475 : GNUNET_FS_SYNC_PATH_MASTER_SEARCH, 1477 : GNUNET_FS_SYNC_PATH_MASTER_SEARCH,
1476 sc->serialization); 1478 sc->serialization);
1479 GNUNET_free (sc->serialization);
1477 } 1480 }
1478 pi.status = GNUNET_FS_STATUS_SEARCH_STOPPED; 1481 pi.status = GNUNET_FS_STATUS_SEARCH_STOPPED;
1479 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc); 1482 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc);
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index 3e59d92be..d39a630db 100644
--- a/src/fs/test_fs_publish_persistence.c
+++ b/src/fs/test_fs_publish_persistence.c
@@ -390,10 +390,16 @@ main (int argc, char *argv[])
390 "nohelp", options, &run, NULL); 390 "nohelp", options, &run, NULL);
391 stop_arm (&p1); 391 stop_arm (&p1);
392 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-publish/"); 392 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-publish/");
393 GNUNET_DISK_directory_remove (fn1); 393 if (fn1 != NULL)
394 GNUNET_free_non_null (fn1); 394 {
395 GNUNET_DISK_directory_remove (fn2); 395 GNUNET_DISK_directory_remove (fn1);
396 GNUNET_free_non_null (fn2); 396 GNUNET_free (fn1);
397 }
398 if (fn2 != NULL)
399 {
400 GNUNET_DISK_directory_remove (fn2);
401 GNUNET_free (fn2);
402 }
397 return err; 403 return err;
398} 404}
399 405
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c
index 861685d32..81beb3382 100644
--- a/src/fs/test_fs_unindex.c
+++ b/src/fs/test_fs_unindex.c
@@ -310,8 +310,11 @@ main (int argc, char *argv[])
310 "nohelp", options, &run, NULL); 310 "nohelp", options, &run, NULL);
311 stop_arm (&p1); 311 stop_arm (&p1);
312 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/"); 312 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/");
313 GNUNET_DISK_directory_remove (fn); 313 if (NULL != fn)
314 GNUNET_free_non_null (fn); 314 {
315 GNUNET_DISK_directory_remove (fn);
316 GNUNET_free (fn);
317 }
315 return 0; 318 return 0;
316} 319}
317 320
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c
index 2185be21d..9bf617ba2 100644
--- a/src/fs/test_fs_unindex_persistence.c
+++ b/src/fs/test_fs_unindex_persistence.c
@@ -375,8 +375,11 @@ main (int argc, char *argv[])
375 "nohelp", options, &run, NULL); 375 "nohelp", options, &run, NULL);
376 stop_arm (&p1); 376 stop_arm (&p1);
377 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/"); 377 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/");
378 GNUNET_DISK_directory_remove (fn); 378 if (NULL != fn)
379 GNUNET_free_non_null (fn); 379 {
380 GNUNET_DISK_directory_remove (fn);
381 GNUNET_free (fn);
382 }
380 return 0; 383 return 0;
381} 384}
382 385
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 48b038cfe..523b9eb5f 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -556,6 +556,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
556 h->action_tail = NULL; 556 h->action_tail = NULL;
557 } 557 }
558 } 558 }
559 h->do_destroy = GNUNET_YES;
559 if ( (h->current != NULL) && 560 if ( (h->current != NULL) &&
560 (h->th == NULL) ) 561 (h->th == NULL) )
561 { 562 {
@@ -567,8 +568,8 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
567 &transmit_action, h); 568 &transmit_action, h);
568 GNUNET_assert (NULL != h->th); 569 GNUNET_assert (NULL != h->th);
569 } 570 }
570 h->do_destroy = GNUNET_YES; 571 if (h->th != NULL)
571 return; 572 return;
572 } 573 }
573 if (NULL != h->th) 574 if (NULL != h->th)
574 { 575 {
diff --git a/src/util/connection.c b/src/util/connection.c
index 4a54aed1d..a877e06c2 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -539,9 +539,14 @@ destroy_continuation (void *cls,
539 notify (sock->nth.notify_ready_cls, 0, NULL); 539 notify (sock->nth.notify_ready_cls, 0, NULL);
540 } 540 }
541 541
542 if ((sock->sock != NULL) && (sock->persist != GNUNET_YES)) 542 if (sock->sock != NULL)
543 GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock)); 543 {
544 544 if (sock->persist != GNUNET_YES)
545 GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock));
546 else
547 GNUNET_free (sock->sock); /* at least no memory leak (we deliberately
548 leak the socket in this special case) ... */
549 }
545 GNUNET_free_non_null (sock->addr); 550 GNUNET_free_non_null (sock->addr);
546 GNUNET_free_non_null (sock->hostname); 551 GNUNET_free_non_null (sock->hostname);
547#if DEBUG_CONNECTION 552#if DEBUG_CONNECTION