[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31635 - gnunet-gtk/src/namestore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31635 - gnunet-gtk/src/namestore |
Date: |
Fri, 20 Dec 2013 22:13:45 +0100 |
Author: grothoff
Date: 2013-12-20 22:13:45 +0100 (Fri, 20 Dec 2013)
New Revision: 31635
Added:
gnunet-gtk/src/namestore/gnunet-namestore-gtk.conf
Modified:
gnunet-gtk/src/namestore/Makefile.am
gnunet-gtk/src/namestore/gnunet-namestore-gtk.c
Log:
-have non-infinite nick expiration time by default
Modified: gnunet-gtk/src/namestore/Makefile.am
===================================================================
--- gnunet-gtk/src/namestore/Makefile.am 2013-12-20 21:13:33 UTC (rev
31634)
+++ gnunet-gtk/src/namestore/Makefile.am 2013-12-20 21:13:45 UTC (rev
31635)
@@ -3,6 +3,7 @@
# we use libgnunetutil to load plugins, and it
# only looks in /gnunet, not /gnunet-gtk!
plugindir = $(libdir)/gnunet
+pkgcfgdir= $(prefix)/share/gnunet/config.d/
AM_CPPFLAGS = \
-I$(top_srcdir)/ \
@@ -10,6 +11,12 @@
bin_PROGRAMS = gnunet-namestore-gtk
+pkgcfg_DATA = \
+ gnunet-namestore-gtk.conf
+
+EXTRA_DIST = \
+ $(pkgcfg_DATA)
+
gnunet_namestore_gtk_SOURCES = \
gnunet-namestore-gtk.c \
gnunet-namestore-gtk_edit.c
Modified: gnunet-gtk/src/namestore/gnunet-namestore-gtk.c
===================================================================
--- gnunet-gtk/src/namestore/gnunet-namestore-gtk.c 2013-12-20 21:13:33 UTC
(rev 31634)
+++ gnunet-gtk/src/namestore/gnunet-namestore-gtk.c 2013-12-20 21:13:45 UTC
(rev 31635)
@@ -304,9 +304,11 @@
};
+/**
+ * When do NICK records expire?
+ */
+static struct GNUNET_TIME_Relative nick_expiration_time;
-
-
/**
* Hash map from the H(name) in the zone to the 'struct RecordInfo'
* for the respective entry in the tree view.
@@ -2139,8 +2141,8 @@
else
{
rd_new[off].record_type = GNUNET_GNSRECORD_TYPE_NICK;
- rd_new[off].expiration_time = UINT64_MAX;
- rd_new[off].flags = GNUNET_GNSRECORD_RF_PRIVATE;
+ rd_new[off].expiration_time = nick_expiration_time.rel_value_us;
+ rd_new[off].flags = GNUNET_GNSRECORD_RF_PRIVATE |
GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
rd_new[off].data_size = strlen (pseu) + 1;
rd_new[off].data = pseu;
}
@@ -2745,16 +2747,32 @@
ml = cls;
cfg = GNUNET_GTK_main_loop_get_configuration (ml);
- if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL))
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &cleanup_task, NULL);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_time (cfg,
+ "namestore-gtk",
+ "NICK_EXPIRATION",
+ &nick_expiration_time))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "namestore-gtk",
+ "NICK_EXPIRATION");
+ GNUNET_SCHEDULER_shutdown ();
return;
+ }
+ if (GNUNET_OK !=
+ GNUNET_GTK_main_loop_build_window (ml, NULL))
+ {
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
GNUNET_GTK_set_icon_search_path ();
GNUNET_GTK_setup_nls ();
main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog"));
main_window = GNUNET_GTK_plug_me ("GNUNET_NAMESTORE_GTK_PLUG",
main_window);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &cleanup_task, NULL);
namestore = GNUNET_NAMESTORE_connect (cfg);
if (NULL == namestore)
Added: gnunet-gtk/src/namestore/gnunet-namestore-gtk.conf
===================================================================
--- gnunet-gtk/src/namestore/gnunet-namestore-gtk.conf
(rev 0)
+++ gnunet-gtk/src/namestore/gnunet-namestore-gtk.conf 2013-12-20 21:13:45 UTC
(rev 31635)
@@ -0,0 +1,2 @@
+[namestore-gtk]
+NICK_EXPIRATION = 1 week
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31635 - gnunet-gtk/src/namestore,
gnunet <=