-allow caller ID to differ from zone used for resolution
[oweals/gnunet.git] / src / dht / gnunet-service-xdht_clients.c
index 453fe38abaf11e290024f80895be337cf8c6be36..0621f8ea8c2328da64363fd82fe62c6b185cac65 100644 (file)
@@ -844,16 +844,8 @@ transmit_request (struct ClientQueryRecord *cqr)
        cqr->replication,
        cqr->seen_replies_count);
 
-  /* FIXME: Is it correct to pass your identity as default current_destination
-   * and current_source. also is it correct to copy your identity into a new
-   * address and then pass this address. address at which your identity is 
-   * stored should be const or else you may overwrite it and you lose your
-   * identity value.  */ 
-  
-  struct GNUNET_PeerIdentity my_identity;
-  my_identity = GDS_NEIGHBOURS_get_my_id ();
   GDS_NEIGHBOURS_send_get (&cqr->key, cqr->type, cqr->msg_options, 
-                           cqr->replication, my_identity, my_identity, NULL,
+                           cqr->replication, NULL, NULL , NULL,
                            0, 0, NULL);
   
   /* exponential back-off for retries.
@@ -918,7 +910,7 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client,
   struct PendingMessage *pm;
   struct GNUNET_DHT_ClientPutConfirmationMessage *conf;
   uint16_t size;
-  FPRINTF (stderr,_("\nSUPU %s, %s, %d"),__FILE__, __func__,__LINE__);
+
   size = ntohs (message->size);
   if (size < sizeof (struct GNUNET_DHT_ClientPutMessage))
   {
@@ -931,7 +923,7 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client,
                             ("# PUT requests received from clients"), 1,
                             GNUNET_NO);
   put_msg = (const struct GNUNET_DHT_ClientPutMessage *) message;
-  LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "R5N CLIENT-PUT %s\n",
+  LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "X-VINE DHT CLIENT-PUT %s\n",
                GNUNET_h2s_full (&put_msg->key));
   /* give to local clients */
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -949,21 +941,16 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client,
                             &put_msg->key, 0, NULL, ntohl (put_msg->type),
                             size - sizeof (struct GNUNET_DHT_ClientPutMessage),
                             &put_msg[1]);
-  
-  /* FIXME: Is it correct to pass your identity as default current_destination
-   * and current_source. also is it correct to copy your identity into a new
-   * address and then pass this address. address at which your identity is 
-   * stored should be const or else you may overwrite it and you lose your
-   * identity value.  */
-  struct GNUNET_PeerIdentity my_identity;
-  my_identity = GDS_NEIGHBOURS_get_my_id();
-  GDS_NEIGHBOURS_send_put (&put_msg->key, &put_msg[1],
-                           size - sizeof (struct GNUNET_DHT_ClientPutMessage),
+  struct GNUNET_PeerIdentity my_identity =  GDS_NEIGHBOURS_get_my_id();
+  GDS_NEIGHBOURS_send_put (&put_msg->key, 
                            ntohl (put_msg->type), ntohl (put_msg->options),
-                           ntohl (put_msg->desired_replication_level),
+                           ntohl (put_msg->desired_replication_level), NULL,
+                           NULL, NULL, 0, 0, NULL,
                            GNUNET_TIME_absolute_ntoh (put_msg->expiration),
-                           my_identity, my_identity, NULL, 0, 0, NULL);
-                           
+                           &put_msg[1],
+                           size - sizeof (struct GNUNET_DHT_ClientPutMessage));
+  
 
   GDS_CLIENTS_process_put (ntohl (put_msg->options),
                            ntohl (put_msg->type),
@@ -1024,7 +1011,7 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
        "Received GET request for %s from local client %p, xq: %.*s\n",
        GNUNET_h2s (&get->key), client, xquery_size, xquery);
 
-  LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "R5N CLIENT-GET %s\n",
+  LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "X-VINE CLIENT-GET %s\n",
                GNUNET_h2s_full (&get->key));
 
 
@@ -1058,12 +1045,6 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
   if (GNUNET_SCHEDULER_NO_TASK != retry_task)
     GNUNET_SCHEDULER_cancel (retry_task);
   retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL);
-  /* perform local lookup 
-   * FIXME: Should we call it here or in neighbours file. And how to handle
-   * this case where we may get the data locally. You really need to rethink
-   * this design again. 
-  GDS_DATACACHE_handle_get (&get->key, cqr->type, cqr->xquery, xquery_size,
-                            NULL, 0); */
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }