arg
[oweals/gnunet.git] / src / fs / gnunet-service-fs_lc.c
index 15dd4897ac36aa4130b865f672b6d31481d51088..c712f58d67a41dd1a4f527141e647bb0917bce54 100644 (file)
@@ -222,6 +222,7 @@ client_request_destroy (void *cls,
  * @param cls user-specified closure
  * @param eval evaluation of the result
  * @param pr handle to the original pending request
+ * @param reply_anonymity_level anonymity level for the reply, UINT32_MAX for "unknown"
  * @param expiration when does 'data' expire? 
  * @param type type of the block
  * @param data response data, NULL on request expiration
@@ -231,6 +232,7 @@ static void
 client_response_handler (void *cls,
                         enum GNUNET_BLOCK_EvaluationResult eval,
                         struct GSF_PendingRequest *pr,
+                        uint32_t reply_anonymity_level,
                         struct GNUNET_TIME_Absolute expiration,
                         enum GNUNET_BLOCK_Type type,
                         const void *data,
@@ -263,14 +265,18 @@ client_response_handler (void *cls,
   GNUNET_assert (pr == cr->pr);
   lc = cr->lc;
   msize = sizeof (struct PutMessage) + data_len;
-  pm = GNUNET_malloc (msize);
-  pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
-  pm->header.size = htons (msize);
-  pm->type = htonl (type);
-  pm->expiration = GNUNET_TIME_absolute_hton (expiration);
-  memcpy (&pm[1], data, data_len);      
-  GSF_local_client_transmit_ (lc, &pm->header);
-#if DEBUG_FS
+  {
+    char buf[msize];
+    
+    pm = (struct PutMessage*) buf;
+    pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
+    pm->header.size = htons (msize);
+    pm->type = htonl (type);
+    pm->expiration = GNUNET_TIME_absolute_hton (expiration);
+    memcpy (&pm[1], data, data_len);      
+    GSF_local_client_transmit_ (lc, &pm->header);
+  }
+#if DEBUG_FS_CLIENT
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Queued reply to query `%s' for local client\n",
              GNUNET_h2s (&prd->query),
@@ -320,7 +326,7 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
   sc = (msize - sizeof (struct SearchMessage)) / sizeof (GNUNET_HashCode);
   sm = (const struct SearchMessage*) message;
   type = ntohl (sm->type);
-#if DEBUG_FS
+#if DEBUG_FS_CLIENT
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Received request for `%s' of type %u from local client\n",
              GNUNET_h2s (&sm->query),
@@ -350,7 +356,7 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
        }
       if (cr != NULL)  
        { 
-#if DEBUG_FS
+#if DEBUG_FS_CLIENT
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                      "Have existing request, merging content-seen lists.\n");
 #endif