gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3574 - GNUnet/src/applications/fs/fsui GNUnet/src/applicat


From: grothoff
Subject: [GNUnet-SVN] r3574 - GNUnet/src/applications/fs/fsui GNUnet/src/applications/stats gnunet-gtk gnunet-gtk/src/common gnunet-gtk/src/plugins/fs gnunet-gtk/src/plugins/stats
Date: Sun, 29 Oct 2006 20:04:16 -0800 (PST)

Author: grothoff
Date: 2006-10-29 20:04:09 -0800 (Sun, 29 Oct 2006)
New Revision: 3574

Modified:
   GNUnet/src/applications/fs/fsui/search.c
   GNUnet/src/applications/fs/fsui/unindex.c
   GNUnet/src/applications/fs/fsui/upload.c
   GNUnet/src/applications/stats/gnunet-stats.c
   gnunet-gtk/gnunet-gtk.glade
   gnunet-gtk/src/common/helper.c
   gnunet-gtk/src/plugins/fs/Makefile.am
   gnunet-gtk/src/plugins/fs/search.c
   gnunet-gtk/src/plugins/stats/Makefile.am
Log:
bugfixes

Modified: GNUnet/src/applications/fs/fsui/search.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search.c    2006-10-30 03:39:08 UTC (rev 
3573)
+++ GNUnet/src/applications/fs/fsui/search.c    2006-10-30 04:04:09 UTC (rev 
3574)
@@ -242,13 +242,6 @@
   FSUI_Event event;
   int ret;
 
-  event.type = FSUI_search_started;
-  event.data.SearchStarted.sc.pos = pos;
-  event.data.SearchStarted.sc.cctx = NULL;
-  event.data.SearchStarted.searchURI = pos->uri;
-  event.data.SearchStarted.anonymityLevel = pos->anonymityLevel;
-  pos->cctx = pos->ctx->ecb(pos->ctx->ecbClosure,
-                           &event);
   ret = ECRS_search(pos->ctx->ectx,
                    pos->ctx->cfg,
                    pos->uri,
@@ -288,6 +281,23 @@
 }
 
 /**
+ * Thread that searches for data (and signals startup).
+ */
+void * FSUI_searchThreadSignal(void * cls) {
+  FSUI_SearchList * pos = cls;
+  FSUI_Event event;
+
+  event.type = FSUI_search_started;
+  event.data.SearchStarted.sc.pos = pos;
+  event.data.SearchStarted.sc.cctx = NULL;
+  event.data.SearchStarted.searchURI = pos->uri;
+  event.data.SearchStarted.anonymityLevel = pos->anonymityLevel;
+  pos->cctx = pos->ctx->ecb(pos->ctx->ecbClosure,
+                           &event);
+  return FSUI_searchThread(pos);
+}
+
+/**
  * Start a search.
  */
 struct FSUI_SearchList *
@@ -314,7 +324,7 @@
   pos->ctx = ctx;
   pos->start_time = get_time();
   pos->timeout = timeout;
-  pos->handle = PTHREAD_CREATE(&FSUI_searchThread,
+  pos->handle = PTHREAD_CREATE(&FSUI_searchThreadSignal,
                               pos,
                               32 * 1024);
   if (pos->handle == NULL) {

Modified: GNUnet/src/applications/fs/fsui/unindex.c
===================================================================
--- GNUnet/src/applications/fs/fsui/unindex.c   2006-10-30 03:39:08 UTC (rev 
3573)
+++ GNUnet/src/applications/fs/fsui/unindex.c   2006-10-30 04:04:09 UTC (rev 
3574)
@@ -73,15 +73,8 @@
                           &size,
                           YES)) {
     GE_BREAK(utc->ctx->ectx, 0);
-    event.data.UnindexCompleted.total = 0;
+    size = 0;
   }
-  event.type = FSUI_unindex_started;
-  event.data.UnindexStarted.uc.pos = utc;
-  event.data.UnindexStarted.uc.cctx = NULL;
-  event.data.UnindexStarted.total = size;
-  event.data.UnindexStarted.filename = utc->filename;
-  utc->cctx = utc->ctx->ecb(utc->ctx->ecbClosure,
-                           &event);
   ret = ECRS_unindexFile(utc->ctx->ectx,
                         utc->ctx->cfg,
                         utc->filename,
@@ -126,6 +119,31 @@
 }
 
 /**
+ * Thread that does the unindex.
+ */
+static void * FSUI_unindexThreadEvent(void * cls) {
+  FSUI_UnindexList * utc = cls;
+  FSUI_Event event;
+  unsigned long long size;
+
+  if (OK != disk_file_size(utc->ctx->ectx,
+                          utc->filename,
+                          &size,
+                          YES)) {
+    GE_BREAK(utc->ctx->ectx, 0);  
+    size = 0;
+  }
+  event.type = FSUI_unindex_started;
+  event.data.UnindexStarted.uc.pos = utc;
+  event.data.UnindexStarted.uc.cctx = NULL;
+  event.data.UnindexStarted.total = size;
+  event.data.UnindexStarted.filename = utc->filename;
+  utc->cctx = utc->ctx->ecb(utc->ctx->ecbClosure,
+                           &event);
+  return FSUI_unindexThread(utc);
+}
+
+/**
  * Start unindexing a file.  Note that an unindex cannot be stopped once
  * started (not necessary anyway), but it can fail.  The function also
  * automatically the unindexed file in the global keyword space under
@@ -155,7 +173,7 @@
   utc->filename = STRDUP(filename);
   utc->start_time = get_time();
   utc->state = FSUI_ACTIVE;
-  utc->handle = PTHREAD_CREATE(&FSUI_unindexThread,
+  utc->handle = PTHREAD_CREATE(&FSUI_unindexThreadEvent,
                               utc,
                               32 * 1024);
   if (utc->handle == NULL) {

Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2006-10-30 03:39:08 UTC (rev 
3573)
+++ GNUnet/src/applications/fs/fsui/upload.c    2006-10-30 04:04:09 UTC (rev 
3574)
@@ -201,10 +201,6 @@
   char * filename;
   struct ECRS_URI * uri;
 
-  if (utc->parent == &utc->shared->ctx->activeUploads) {
-    /* top-level call: signal client! */
-    signalUploadStarted(utc, 1);
-  }
   ectx = utc->shared->ctx->ectx;
   GE_ASSERT(ectx, utc->filename != NULL);
   cpos = utc->child;
@@ -327,6 +323,20 @@
   return NULL;
 }
 
+/**
+ * Thread that does the upload.
+ */
+static void * FSUI_uploadThreadEvent(void * cls) {
+  FSUI_UploadList * utc = cls;
+ 
+  if (utc->parent == &utc->shared->ctx->activeUploads) {
+    /* top-level call: signal client! */
+    signalUploadStarted(utc, 1);
+  }
+  return FSUI_uploadThread(utc);
+}
+
+
 static void freeUploadList(struct FSUI_UploadList * ul) {
   struct FSUI_UploadList * next;
   struct FSUI_Context * ctx;
@@ -543,7 +553,7 @@
                  keyUri,
                  md,
                  &ctx->activeUploads);
-  shared->handle = PTHREAD_CREATE(&FSUI_uploadThread,
+  shared->handle = PTHREAD_CREATE(&FSUI_uploadThreadEvent,
                                  ul,
                                  128 * 1024);
   if (shared->handle == NULL) {

Modified: GNUnet/src/applications/stats/gnunet-stats.c
===================================================================
--- GNUnet/src/applications/stats/gnunet-stats.c        2006-10-30 03:39:08 UTC 
(rev 3573)
+++ GNUnet/src/applications/stats/gnunet-stats.c        2006-10-30 04:04:09 UTC 
(rev 3574)
@@ -26,6 +26,7 @@
  */
 
 #include "platform.h"
+#include "gnunet_directories.h"
 #include "gnunet_util.h"
 #include "gnunet_util_boot.h"
 #include "gnunet_stats_lib.h"
@@ -33,7 +34,7 @@
 
 static int lastIp2p = 42; /* not YES or NO */
 
-static char * cfgFilename;
+static char * cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
 
 /**
  * Print statistics received.

Modified: gnunet-gtk/gnunet-gtk.glade
===================================================================
--- gnunet-gtk/gnunet-gtk.glade 2006-10-30 03:39:08 UTC (rev 3573)
+++ gnunet-gtk/gnunet-gtk.glade 2006-10-30 04:04:09 UTC (rev 3574)
@@ -914,7 +914,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_abortSearchSummaryButton_clicked_" last_modification_time="Sun, 22 
Oct 2006 06:07:10 GMT"/>
+                                 <signal name="clicked" 
handler="on_abortSearchSummaryButton_clicked_" object="activeSearchesSummary" 
last_modification_time="Sun, 22 Oct 2006 06:07:10 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -932,7 +932,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_closeSearchSummaryButton_clicked_" last_modification_time="Sun, 22 
Oct 2006 06:07:31 GMT"/>
+                                 <signal name="clicked" 
handler="on_closeSearchSummaryButton_clicked_" object="activeSearchesSummary" 
last_modification_time="Sun, 22 Oct 2006 06:07:31 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1236,7 +1236,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_abortDownloadButton_clicked_" last_modification_time="Wed, 01 Jun 
2005 19:54:07 GMT"/>
+                                 <signal name="clicked" 
handler="on_abortDownloadButton_clicked_" object="activeDownloadsList" 
last_modification_time="Wed, 01 Jun 2005 19:54:07 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1254,7 +1254,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_stopDownloadButton_clicked_" last_modification_time="Sun, 22 Oct 
2006 06:00:17 GMT"/>
+                                 <signal name="clicked" 
handler="on_stopDownloadButton_clicked_" object="activeDownloadsList" 
last_modification_time="Sun, 22 Oct 2006 06:00:17 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1272,7 +1272,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_clearCompletedDownloadsButton_clicked_" 
last_modification_time="Wed, 01 Jun 2005 19:53:58 GMT"/>
+                                 <signal name="clicked" 
handler="on_clearCompletedDownloadsButton_clicked_" 
object="activeDownloadsList" last_modification_time="Wed, 01 Jun 2005 19:53:58 
GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1378,7 +1378,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_abortUploadButton_clicked_" last_modification_time="Sun, 22 Oct 
2006 06:05:17 GMT"/>
+                                 <signal name="clicked" 
handler="on_abortUploadButton_clicked_" object="activeUploadsList" 
last_modification_time="Sun, 22 Oct 2006 06:05:17 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1396,7 +1396,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_stopUploadButton_clicked_" last_modification_time="Sun, 22 Oct 2006 
06:05:24 GMT"/>
+                                 <signal name="clicked" 
handler="on_stopUploadButton_clicked_" object="activeUploadsList" 
last_modification_time="Sun, 22 Oct 2006 06:05:24 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>
@@ -1414,7 +1414,7 @@
                                  <property name="use_stock">True</property>
                                  <property 
name="relief">GTK_RELIEF_NORMAL</property>
                                  <property 
name="focus_on_click">True</property>
-                                 <signal name="clicked" 
handler="on_clearCompletedUploadsButton_clicked_" last_modification_time="Mon, 
30 Oct 2006 00:26:29 GMT"/>
+                                 <signal name="clicked" 
handler="on_clearCompletedUploadsButton_clicked_" object="activeUploadsList" 
last_modification_time="Mon, 30 Oct 2006 00:26:29 GMT"/>
                                </widget>
                                <packing>
                                  <property name="padding">0</property>

Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c      2006-10-30 03:39:08 UTC (rev 3573)
+++ gnunet-gtk/src/common/helper.c      2006-10-30 04:04:09 UTC (rev 3574)
@@ -427,7 +427,7 @@
   GC_get_configuration_value_string(cfg,
                                    "GNUNET-GTK",
                                    "PLUGINS",
-                                   "about daemon fs",
+                                   "about daemon fs stats",
                                    &load);
   loadPlugins(load);
   FREE(load);

Modified: gnunet-gtk/src/plugins/fs/Makefile.am
===================================================================
--- gnunet-gtk/src/plugins/fs/Makefile.am       2006-10-30 03:39:08 UTC (rev 
3573)
+++ gnunet-gtk/src/plugins/fs/Makefile.am       2006-10-30 04:04:09 UTC (rev 
3574)
@@ -5,7 +5,7 @@
   @GNUNETGTK_CFLAGS@
 
 plugindir = $(libdir)/GNUnet
- 
+
 plugin_LTLIBRARIES = \
   libgnunetgtkmodule_fs.la
 

Modified: gnunet-gtk/src/plugins/fs/search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/search.c  2006-10-30 03:39:08 UTC (rev 3573)
+++ gnunet-gtk/src/plugins/fs/search.c  2006-10-30 04:04:09 UTC (rev 3574)
@@ -677,8 +677,8 @@
 /**
  * The stop button in the search summary was clicked.
  */
-void on_closeSearchSummaryButton_clicked_fs(GtkWidget * closeButton,
-                                           GtkWidget * treeview) {
+void on_closeSearchSummaryButton_clicked_fs(GtkWidget * treeview,
+                                           GtkWidget * closeButton) {
   GtkTreeSelection * selection;
 
   selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
@@ -711,8 +711,8 @@
 /**
  * The abort button in the search summary was clicked.
  */
-void on_abortSearchSummaryButton_clicked_fs(GtkWidget * closeButton,
-                                           GtkWidget * treeview) {
+void on_abortSearchSummaryButton_clicked_fs(GtkWidget * treeview,
+                                           GtkWidget * closeButton) {
   GtkTreeSelection * selection;
 
   selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));

Modified: gnunet-gtk/src/plugins/stats/Makefile.am
===================================================================
--- gnunet-gtk/src/plugins/stats/Makefile.am    2006-10-30 03:39:08 UTC (rev 
3573)
+++ gnunet-gtk/src/plugins/stats/Makefile.am    2006-10-30 04:04:09 UTC (rev 
3574)
@@ -13,9 +13,10 @@
   functions.c functions.h \
   statistics.c
 libgnunetgtkmodule_stats_la_LIBADD = \
-        @GTK_LIBS@ @GNUNETGTK_LIBS@ \
+  @GTK_LIBS@ @GNUNETGTK_LIBS@ \
   $(top_builddir)/src/common/libgnunetgtk_common.la \
   -lgnunetutil \
+  -lgnunetutil_cron \
   -lgnunetgetoption_api \
   -lgnunetstats_api
 libgnunetgtkmodule_stats_la_LDFLAGS = \





reply via email to

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