gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r9246 - GNUnet/src/applications/fs/tools


From: gnunet
Subject: [GNUnet-SVN] r9246 - GNUnet/src/applications/fs/tools
Date: Thu, 22 Oct 2009 19:06:23 -0600

Author: nevans
Date: 2009-10-22 19:06:23 -0600 (Thu, 22 Oct 2009)
New Revision: 9246

Modified:
   GNUnet/src/applications/fs/tools/gnunet-download.c
   GNUnet/src/applications/fs/tools/gnunet-search.c
Log:
locURI debug check

Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c  2009-10-23 01:01:27 UTC 
(rev 9245)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c  2009-10-23 01:06:23 UTC 
(rev 9246)
@@ -58,7 +58,7 @@
 #define EC_INCOMPLETE 1
 #define EC_ABORTED 2
 #define EC_DOWNLOAD_ERROR 3
-
+#define DEBUG GNUNET_NO
 static int errorCode;
 
 static unsigned int downloads_running;
@@ -222,6 +222,9 @@
   struct GNUNET_ECRS_URI *uri;
   struct GNUNET_MetaData *meta;
   int i;
+#if DEBUG
+  GNUNET_EncName *enc;
+#endif
 
   i = GNUNET_init (argc,
                    argv,
@@ -248,6 +251,17 @@
   if (!do_directory)
     {
       uri = GNUNET_ECRS_string_to_uri (ectx, argv[i]);
+#if DEBUG
+      if (GNUNET_ECRS_uri_test_loc (uri))
+        {
+          enc = GNUNET_malloc (sizeof (GNUNET_EncName));
+          GNUNET_ECRS_locURI_extract_peer (uri, &enc);
+          fprintf (stdout,
+                   "gnunet-download got locURI. Data located at peer %s.\n",
+                   (char *) enc);
+          GNUNET_free (enc);
+#endif
+        }
       if ((NULL == uri) ||
           (!(GNUNET_ECRS_uri_test_loc (uri)
              || GNUNET_ECRS_uri_test_chk (uri))))

Modified: GNUnet/src/applications/fs/tools/gnunet-search.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-search.c    2009-10-23 01:01:27 UTC 
(rev 9245)
+++ GNUnet/src/applications/fs/tools/gnunet-search.c    2009-10-23 01:06:23 UTC 
(rev 9246)
@@ -29,6 +29,7 @@
 #include "gnunet_fsui_lib.h"
 #include "gnunet_util.h"
 
+#define DEBUG 1
 
 static struct GNUNET_GE_Context *ectx;
 
@@ -71,6 +72,10 @@
   char *uri;
   char *filename;
 
+#if DEBUG
+  GNUNET_EncName *enc;
+  enc = GNUNET_malloc (sizeof (GNUNET_EncName));
+#endif
   switch (event->type)
     {
     case GNUNET_FSUI_search_aborted:
@@ -86,6 +91,15 @@
         GNUNET_meta_data_duplicate (event->data.SearchResult.fi.meta);
 
       uri = GNUNET_ECRS_uri_to_string (event->data.SearchResult.fi.uri);
+#if DEBUG
+      if (GNUNET_ECRS_uri_test_loc (event->data.SearchResult.fi.uri))
+        {
+          GNUNET_ECRS_locURI_extract_peer (event->data.SearchResult.fi.uri,
+                                           &enc);
+          fprintf (stdout, "Received locURI putting data at peer %s\n",
+                   (char *) enc);
+        }
+#endif
       printf ("%s:\n", uri);
       filename =
         GNUNET_meta_data_get_by_type (event->data.SearchResult.fi.meta,
@@ -103,7 +117,7 @@
         printf ("gnunet-download %s\n", uri);
       printMeta (event->data.SearchResult.fi.meta);
       printf ("\n");
-      fflush(stdout);
+      fflush (stdout);
       GNUNET_free_non_null (filename);
       GNUNET_free (uri);
       break;





reply via email to

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