-check return value
[oweals/gnunet.git] / src / gns / gnunet-service-gns.c
index 530318808785afe2d1a27322531920f234fdaa1a..50b370264939d9535f5c23e1dc20691ba334bdb4 100644 (file)
@@ -259,7 +259,7 @@ shutdown_task (void *cls,
   GNUNET_SERVER_notification_context_destroy (nc);
   while (NULL != (clh = clh_head))
   {
-    GNUNET_SERVER_client_set_user_context (clh->client, NULL);
+    GNUNET_SERVER_client_set_user_context (clh->client, (void *)NULL);
     GNS_resolver_lookup_cancel (clh->lookup);
     GNUNET_CONTAINER_DLL_remove (clh_head, clh_tail, clh);
     GNUNET_free (clh);
@@ -469,6 +469,8 @@ perform_dht_put (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
                                         label,
                                         rd_public,
                                         rd_public_count);
+  if (NULL == block)
+    return NULL; /* whoops */
   block_size = ntohl (block->purpose.size)
     + sizeof (struct GNUNET_CRYPTO_EcdsaSignature)
     + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
@@ -476,7 +478,9 @@ perform_dht_put (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
                                           label,
                                           &query);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Storing record in DHT with expiration `%s' under key %s\n",
+              "Storing %u record(s) for label `%s' in DHT with expiration `%s' under key %s\n",
+              rd_public_count,
+              label,
               GNUNET_STRINGS_absolute_time_to_string (expire),
               GNUNET_h2s (&query));
   ret = GNUNET_DHT_put (dht_handle, &query,
@@ -702,7 +706,7 @@ send_lookup_response (void* cls,
                                              GNUNET_NO);
   GNUNET_free (rmsg);
   GNUNET_CONTAINER_DLL_remove (clh_head, clh_tail, clh);
-  GNUNET_SERVER_client_set_user_context (clh->client, NULL);
+  GNUNET_SERVER_client_set_user_context (clh->client, (void *)NULL);
   GNUNET_free (clh);
   GNUNET_STATISTICS_update (statistics,
                             "Completed lookups", 1,
@@ -758,7 +762,7 @@ handle_lookup (void *cls,
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
-  GNUNET_STRINGS_utf8_tolower (utf_in, &nameptr);
+  GNUNET_STRINGS_utf8_tolower (utf_in, nameptr);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 
   clh = GNUNET_new (struct ClientLookupHandle);
@@ -786,7 +790,7 @@ handle_lookup (void *cls,
                                     ntohl (sh_msg->type),
                                     name,
                                     key,
-                                    ntohl (sh_msg->only_cached),
+                                    (enum GNUNET_GNS_LocalOptions) ntohs (sh_msg->options),
                                     &send_lookup_response, clh);
   GNUNET_STATISTICS_update (statistics,
                             "Lookup attempts",