diff options
Diffstat (limited to 'src/namestore/gnunet-namestore-gtk.c')
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index 7b3e1f9f..cea5ce0c 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -304,8 +304,10 @@ struct RecordInfo | |||
304 | }; | 304 | }; |
305 | 305 | ||
306 | 306 | ||
307 | 307 | /** | |
308 | 308 | * When do NICK records expire? | |
309 | */ | ||
310 | static struct GNUNET_TIME_Relative nick_expiration_time; | ||
309 | 311 | ||
310 | /** | 312 | /** |
311 | * Hash map from the H(name) in the zone to the 'struct RecordInfo' | 313 | * Hash map from the H(name) in the zone to the 'struct RecordInfo' |
@@ -2139,8 +2141,8 @@ gnunet_namestore_gtk_pseu_entry_changed_cb (GtkEditable *editable, | |||
2139 | else | 2141 | else |
2140 | { | 2142 | { |
2141 | rd_new[off].record_type = GNUNET_GNSRECORD_TYPE_NICK; | 2143 | rd_new[off].record_type = GNUNET_GNSRECORD_TYPE_NICK; |
2142 | rd_new[off].expiration_time = UINT64_MAX; | 2144 | rd_new[off].expiration_time = nick_expiration_time.rel_value_us; |
2143 | rd_new[off].flags = GNUNET_GNSRECORD_RF_PRIVATE; | 2145 | rd_new[off].flags = GNUNET_GNSRECORD_RF_PRIVATE | GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; |
2144 | rd_new[off].data_size = strlen (pseu) + 1; | 2146 | rd_new[off].data_size = strlen (pseu) + 1; |
2145 | rd_new[off].data = pseu; | 2147 | rd_new[off].data = pseu; |
2146 | } | 2148 | } |
@@ -2745,16 +2747,32 @@ run (void *cls, | |||
2745 | 2747 | ||
2746 | ml = cls; | 2748 | ml = cls; |
2747 | cfg = GNUNET_GTK_main_loop_get_configuration (ml); | 2749 | cfg = GNUNET_GTK_main_loop_get_configuration (ml); |
2748 | if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) | 2750 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
2751 | &cleanup_task, NULL); | ||
2752 | if (GNUNET_OK != | ||
2753 | GNUNET_CONFIGURATION_get_value_time (cfg, | ||
2754 | "namestore-gtk", | ||
2755 | "NICK_EXPIRATION", | ||
2756 | &nick_expiration_time)) | ||
2757 | { | ||
2758 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | ||
2759 | "namestore-gtk", | ||
2760 | "NICK_EXPIRATION"); | ||
2761 | GNUNET_SCHEDULER_shutdown (); | ||
2749 | return; | 2762 | return; |
2763 | } | ||
2764 | if (GNUNET_OK != | ||
2765 | GNUNET_GTK_main_loop_build_window (ml, NULL)) | ||
2766 | { | ||
2767 | GNUNET_SCHEDULER_shutdown (); | ||
2768 | return; | ||
2769 | } | ||
2750 | GNUNET_GTK_set_icon_search_path (); | 2770 | GNUNET_GTK_set_icon_search_path (); |
2751 | GNUNET_GTK_setup_nls (); | 2771 | GNUNET_GTK_setup_nls (); |
2752 | 2772 | ||
2753 | main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog")); | 2773 | main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog")); |
2754 | main_window = GNUNET_GTK_plug_me ("GNUNET_NAMESTORE_GTK_PLUG", | 2774 | main_window = GNUNET_GTK_plug_me ("GNUNET_NAMESTORE_GTK_PLUG", |
2755 | main_window); | 2775 | main_window); |
2756 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | ||
2757 | &cleanup_task, NULL); | ||
2758 | 2776 | ||
2759 | namestore = GNUNET_NAMESTORE_connect (cfg); | 2777 | namestore = GNUNET_NAMESTORE_connect (cfg); |
2760 | if (NULL == namestore) | 2778 | if (NULL == namestore) |