-add missing comments, expand error checking
[oweals/gnunet.git] / src / dht / gnunet-dht-get.c
index 8720e76aa84e7fa02a631e56348e0ee987def47d..6ad4b30f8e05d0b84eb02425effc663037780b18 100644 (file)
@@ -124,12 +124,12 @@ static void
 get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
                      const GNUNET_HashCode * key,
                      const struct GNUNET_PeerIdentity *get_path,
-                    unsigned int get_path_length,
+                     unsigned int get_path_length,
                      const struct GNUNET_PeerIdentity *put_path,
-                    unsigned int put_path_length,
-                     enum GNUNET_BLOCK_Type type, size_t size, const void *data)
+                     unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
+                     size_t size, const void *data)
 {
-  fprintf (stdout, "Result %d, type %d:\n%.*s\n", result_count, type,
+  FPRINTF (stdout, "Result %d, type %d:\n%.*s\n", result_count, type,
            (unsigned int) size, (char *) data);
   result_count++;
 }
@@ -155,7 +155,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   if (query_key == NULL)
   {
     if (verbose)
-      fprintf (stderr, "Must provide key for DHT GET!\n");
+      FPRINTF (stderr, "%s",  "Must provide key for DHT GET!\n");
     ret = 1;
     return;
   }
@@ -165,12 +165,12 @@ run (void *cls, char *const *args, const char *cfgfile,
   if (dht_handle == NULL)
   {
     if (verbose)
-      fprintf (stderr, "Couldn't connect to DHT service!\n");
+      FPRINTF (stderr, "%s",  "Couldn't connect to DHT service!\n");
     ret = 1;
     return;
   }
   else if (verbose)
-    fprintf (stderr, "Connected to DHT service!\n");
+    FPRINTF (stderr, "%s",  "Connected to DHT service!\n");
 
   if (query_type == GNUNET_BLOCK_TYPE_ANY)      /* Type of data not set */
     query_type = GNUNET_BLOCK_TYPE_TEST;
@@ -182,13 +182,13 @@ run (void *cls, char *const *args, const char *cfgfile,
   absolute_timeout = GNUNET_TIME_relative_to_absolute (timeout);
 
   if (verbose)
-    fprintf (stderr, "Issuing GET request for %s!\n", query_key);
+    FPRINTF (stderr, "Issuing GET request for %s!\n", query_key);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
                                 (absolute_timeout), &cleanup_task, NULL);
   get_handle =
-      GNUNET_DHT_get_start (dht_handle, timeout, query_type, &key,
-                            replication, GNUNET_DHT_RO_NONE, NULL,
-                            0, &get_result_iterator, NULL);
+      GNUNET_DHT_get_start (dht_handle, timeout, query_type, &key, replication,
+                            GNUNET_DHT_RO_NONE, NULL, 0, &get_result_iterator,
+                            NULL);
 
 }