trying to fix #3576
[oweals/gnunet.git] / src / fs / gnunet-service-fs_cadet_server.c
index 77add757da19938b42bd82339f1602e9f389904c..6ce18afb5593686820c5290ab3ae467525d00875 100644 (file)
@@ -324,7 +324,8 @@ continue_writing (struct CadetClient *sc)
 static void
 handle_datastore_reply (void *cls,
                        const struct GNUNET_HashCode *key,
-                       size_t size, const void *data,
+                       size_t size, 
+                       const void *data,
                        enum GNUNET_BLOCK_Type type,
                        uint32_t priority,
                        uint32_t anonymity,
@@ -345,11 +346,19 @@ handle_datastore_reply (void *cls,
        hard error as we might have had the answer in the
        past and the user might have unindexed it. Hence
        we log at level "INFO" for now. */
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Have no answer for query `%s'\n",
-                GNUNET_h2s (key));
+    if (NULL == key)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Have no answer and the query was NULL\n");
+    }
+    else
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 "Have no answer for query `%s'\n",
+                 GNUNET_h2s (key));
+    }
     GNUNET_STATISTICS_update (GSF_stats,
-                              gettext_noop ("# queries received via cadet not answered"), 1,
+                              gettext_noop ("# queries received via CADET not answered"), 1,
                               GNUNET_NO);
     continue_writing (sc);
     return;
@@ -406,9 +415,9 @@ handle_datastore_reply (void *cls,
  * Functions with this signature are called whenever a
  * complete query message is received.
  *
- * Do not call #GNUNET_SERVER_mst_destroy in callback
+ * Do not call #GNUNET_SERVER_mst_destroy() in callback
  *
- * @param cls closure with the 'struct CadetClient'
+ * @param cls closure with the `struct CadetClient`
  * @param channel channel handle
  * @param channel_ctx channel context
  * @param message the actual message