fix compile errors
authorChristian Grothoff <christian@grothoff.org>
Thu, 21 Jan 2010 14:58:56 +0000 (14:58 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 21 Jan 2010 14:58:56 +0000 (14:58 +0000)
src/core/core_api_peer_get_info.c
src/fs/gnunet-service-fs.c
src/topology/gnunet-daemon-topology.c

index d7ecd9cbb22b6249f7da56f370066e702e7dd2d5..cd963375f268a171bea3d8650e5e6601d42aaa1f 100644 (file)
@@ -20,7 +20,7 @@
 
 /**
  * @file core/core_api_peer_get_info.c
- * @brief implementation of the peer_get_info functions 
+ * @brief implementation of the peer_change_preference functions 
  * @author Christian Grothoff
  */
 #include "platform.h"
@@ -167,7 +167,7 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_SCHEDULER_Handle *sched,
  * @param irc context returned by the original GNUNET_CORE_peer_get_info call
  */
 void
-GNUNET_CORE_peer_get_info_cancel (struct GNUNET_CORE_InformationRequestContext *irc)
+GNUNET_CORE_peer_change_preference_cancel (struct GNUNET_CORE_InformationRequestContext *irc)
 {
   GNUNET_CLIENT_disconnect (irc->client);
   GNUNET_free (irc);
index 4ce618bf7f891881fa21592f0a20cf98bef75d55..541f656c6b8349d2cf94f0f33b44594caabaedcd 100644 (file)
@@ -417,7 +417,7 @@ struct PendingRequest
   struct GNUNET_CONTAINER_BloomFilter *bf;
 
   /**
-   * Context of our GNUNET_CORE_peer_get_info call.
+   * Context of our GNUNET_CORE_peer_change_preference call.
    */
   struct GNUNET_CORE_InformationRequestContext *irc;
 
@@ -1770,8 +1770,6 @@ transmit_request_cb (void *cls,
  *
  * @param cls the requests "struct PendingRequest*"
  * @param peer identifies the peer
- * @param latency current latency estimate, "FOREVER" if we have been
- *                disconnected
  * @param bpm_in set to the current bandwidth limit (receiving) for this peer
  * @param bpm_out set to the current bandwidth limit (sending) for this peer
  * @param amount set to the amount that was actually reserved or unreserved
@@ -1783,9 +1781,8 @@ target_reservation_cb (void *cls,
                       GNUNET_PeerIdentity * peer,
                       unsigned int bpm_in,
                       unsigned int bpm_out,
-                      struct GNUNET_TIME_Relative
-                      latency, int amount,
-                      unsigned long long preference)
+                      int amount,
+                      uint64_t preference)
 {
   struct PendingRequest *pr = cls;
   uint32_t priority;
@@ -1872,7 +1869,7 @@ forward_request_task (void *cls,
     }
   /* (2) reserve reply bandwidth */
   GNUNET_assert (NULL == pr->irc);
-  pr->irc = GNUNET_CORE_peer_get_info (sched, cfg,
+  pr->irc = GNUNET_CORE_peer_change_preference (sched, cfg,
                                       &psc.target,
                                       GNUNET_CONSTANTS_SERVICE_TIMEOUT, 
                                       -1,
@@ -2222,7 +2219,7 @@ destroy_pending_request (struct PendingRequest *pr)
   // also, what does the return value mean?
   if (pr->irc != NULL)
     {
-      GNUNET_CORE_peer_get_info_cancel (pr->irc);
+      GNUNET_CORE_peer_change_preference_cancel (pr->irc);
       pr->irc = NULL;
     }
   if (pr->client == NULL)
@@ -2407,11 +2404,15 @@ destroy_request (void *cls,
  *
  * @param cls closure, not used
  * @param peer peer identity this notification is about
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other' 
  */
 static void 
 peer_connect_handler (void *cls,
                      const struct
-                     GNUNET_PeerIdentity * peer)
+                     GNUNET_PeerIdentity * peer,
+                     struct GNUNET_TIME_Relative latency,
+                     uint32_t distance)
 {
   struct ConnectedPeer *cp;
 
@@ -2773,13 +2774,17 @@ bound_priority (uint32_t prio_in,
  * @param other the other peer involved (sender or receiver, NULL
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual message
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other' 
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_p2p_get (void *cls,
                const struct GNUNET_PeerIdentity *other,
-               const struct GNUNET_MessageHeader *message)
+               const struct GNUNET_MessageHeader *message,
+                                 struct GNUNET_TIME_Relative latency,
+                                 uint32_t distance)
 {
   uint16_t msize;
   const struct GetMessage *gm;
@@ -2923,10 +2928,10 @@ handle_p2p_get (void *cls,
   if (preference < QUERY_BANDWIDTH_VALUE)
     preference = QUERY_BANDWIDTH_VALUE;
   // FIXME: also reserve bandwidth for reply?
-  (void) GNUNET_CORE_peer_get_info (sched, cfg,
-                                   other,
-                                   GNUNET_TIME_UNIT_FOREVER_REL,
-                                   0, 0, preference, NULL, NULL);
+  (void) GNUNET_CORE_peer_change_preference (sched, cfg,
+                                            other,
+                                            GNUNET_TIME_UNIT_FOREVER_REL,
+                                            0, 0, preference, NULL, NULL);
   if (0 != (pgc->policy & ROUTING_POLICY_ANSWER))
     pgc->drq = queue_ds_request (BASIC_DATASTORE_REQUEST_DELAY,
                                 &ds_get_request,
@@ -3205,13 +3210,17 @@ check_sblock (const struct SBlock *sb,
  * @param other the other peer involved (sender or receiver, NULL
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual message
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other' 
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_p2p_put (void *cls,
                const struct GNUNET_PeerIdentity *other,
-               const struct GNUNET_MessageHeader *message)
+               const struct GNUNET_MessageHeader *message,
+               struct GNUNET_TIME_Relative latency,
+               uint32_t distance)
 {
   const struct PutMessage *put;
   uint16_t msize;
index d16869afd6629f906ae92e554f98799c5e1871a9..ff93f4145da9b871a18101ea53a78ad11f4b0079 100644 (file)
@@ -258,23 +258,11 @@ static struct DisconnectList *disconnect_tail;
  * has completed.
  *
  * @param cls our 'struct DisconnectList'
- * @param peer NULL on error (then what?)
- * @param bpm_in set to the current bandwidth limit (receiving) for this peer
- * @param bpm_out set to the current bandwidth limit (sending) for this peer
- * @param latency current latency estimate, "FOREVER" if we have been
- *                disconnected
- * @param amount set to the amount that was actually reserved or unreserved
- * @param preference current traffic preference for the given peer
+ * @param tc unused
  */
 static void
 disconnect_done (void *cls,
-                const struct
-                GNUNET_PeerIdentity * peer,
-                unsigned int bpm_in,
-                unsigned int bpm_out,
-                struct GNUNET_TIME_Relative
-                latency, int amount,
-                unsigned long long preference)
+                const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct DisconnectList *dl = cls;
 
@@ -620,11 +608,15 @@ reschedule_hellos (struct PeerList *peer)
  *
  * @param cls closure
  * @param peer peer identity this notification is about
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other' 
  */
 static void 
 connect_notify (void *cls,
                const struct
-               GNUNET_PeerIdentity * peer)
+               GNUNET_PeerIdentity * peer,
+               struct GNUNET_TIME_Relative latency,
+               uint32_t distance)
 {
   struct PeerList *pos;
 
@@ -1092,6 +1084,8 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
  * @param other the other peer involved (sender or receiver, NULL
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual HELLO message
+ * @param latency reported latency of the connection with 'other'
+ * @param distance reported distance (DV) to 'other' 
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -1099,7 +1093,9 @@ static int
 handle_encrypted_hello (void *cls,
                        const struct GNUNET_PeerIdentity * other,
                        const struct GNUNET_MessageHeader *
-                       message)
+                       message,
+                       struct GNUNET_TIME_Relative latency,
+                       uint32_t distance)
 {
 #if DEBUG_TOPOLOGY
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1213,7 +1209,7 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       GNUNET_CONTAINER_DLL_remove (disconnect_head,
                                   disconnect_tail,
                                   dl);
-      GNUNET_CORE_peer_get_info_cancel (dl->rh);
+      GNUNET_CORE_peer_request_cancel (dl->rh);
       GNUNET_free (dl);
     }
 }