fix only cache variable long/short
[oweals/gnunet.git] / src / gns / gns_api.c
index b75755e259c8a75a1b4d86bdfcfa30d86ea2731c..66bd005cf0b4dd364e8851fb0d187e96071e7898 100644 (file)
@@ -390,7 +390,7 @@ process_lookup_reply (struct GNUNET_GNS_LookupRequest *qe,
                                                              rd))
   {
     LOG (GNUNET_ERROR_TYPE_ERROR,
-        _("Failed to serialize lookup reply from GNS service!\n"));
+        _("Failed to deserialize lookup reply from GNS service!\n"));
     proc (proc_cls, 0, NULL);
   }
   else
@@ -422,6 +422,9 @@ process_message (void *cls, const struct GNUNET_MessageHeader *msg)
     force_reconnect (handle);
     return;
   }
+
+  GNUNET_CLIENT_receive (handle->client, &process_message, handle,
+                        GNUNET_TIME_UNIT_FOREVER_REL);
   switch (ntohs (msg->type))
   {
   case GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT:
@@ -447,8 +450,6 @@ process_message (void *cls, const struct GNUNET_MessageHeader *msg)
     force_reconnect (handle);
     return;
   }
-  GNUNET_CLIENT_receive (handle->client, &process_message, handle,
-                        GNUNET_TIME_UNIT_FOREVER_REL);
 }
 
 
@@ -525,14 +526,14 @@ GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr)
  * @param only_cached #GNUNET_YES to only check locally (not in the DHT)
  * @param shorten_zone_key the private key of the shorten zone (can be NULL)
  * @param proc processor to call on result
- * @param proc_cls closure for processor
+ * @param proc_cls closure for @a proc
  * @return handle to the get request
  */
 struct GNUNET_GNS_LookupRequest*
 GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
                   const char *name,
                   const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
-                  int type,
+                  uint32_t type,
                   int only_cached,
                   const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone_key,
                   GNUNET_GNS_LookupResultProcessor proc,
@@ -575,7 +576,7 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
   lookup_msg->header.type = htons (GNUNET_MESSAGE_TYPE_GNS_LOOKUP);
   lookup_msg->header.size = htons (msize);
   lookup_msg->id = htonl (lr->r_id);
-  lookup_msg->only_cached = htonl (only_cached);
+  lookup_msg->only_cached = htons (only_cached);
   lookup_msg->zone = *zone;
   lookup_msg->type = htonl (type);
   if (NULL != shorten_zone_key)