aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-01-21 14:58:56 +0000
committerChristian Grothoff <christian@grothoff.org>2010-01-21 14:58:56 +0000
commit725a6d5cdbcc11b21e992edb20344f1695e076cc (patch)
tree651d495437222962dbd014c775991fd3a30c1d3c /src
parentd973b1bf149653e42441cd94ae177d82a4eb311c (diff)
downloadgnunet-725a6d5cdbcc11b21e992edb20344f1695e076cc.tar.gz
gnunet-725a6d5cdbcc11b21e992edb20344f1695e076cc.zip
fix compile errors
Diffstat (limited to 'src')
-rw-r--r--src/core/core_api_peer_get_info.c4
-rw-r--r--src/fs/gnunet-service-fs.c39
-rw-r--r--src/topology/gnunet-daemon-topology.c30
3 files changed, 39 insertions, 34 deletions
diff --git a/src/core/core_api_peer_get_info.c b/src/core/core_api_peer_get_info.c
index d7ecd9cbb..cd963375f 100644
--- a/src/core/core_api_peer_get_info.c
+++ b/src/core/core_api_peer_get_info.c
@@ -20,7 +20,7 @@
20 20
21/** 21/**
22 * @file core/core_api_peer_get_info.c 22 * @file core/core_api_peer_get_info.c
23 * @brief implementation of the peer_get_info functions 23 * @brief implementation of the peer_change_preference functions
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
@@ -167,7 +167,7 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_SCHEDULER_Handle *sched,
167 * @param irc context returned by the original GNUNET_CORE_peer_get_info call 167 * @param irc context returned by the original GNUNET_CORE_peer_get_info call
168 */ 168 */
169void 169void
170GNUNET_CORE_peer_get_info_cancel (struct GNUNET_CORE_InformationRequestContext *irc) 170GNUNET_CORE_peer_change_preference_cancel (struct GNUNET_CORE_InformationRequestContext *irc)
171{ 171{
172 GNUNET_CLIENT_disconnect (irc->client); 172 GNUNET_CLIENT_disconnect (irc->client);
173 GNUNET_free (irc); 173 GNUNET_free (irc);
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 4ce618bf7..541f656c6 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -417,7 +417,7 @@ struct PendingRequest
417 struct GNUNET_CONTAINER_BloomFilter *bf; 417 struct GNUNET_CONTAINER_BloomFilter *bf;
418 418
419 /** 419 /**
420 * Context of our GNUNET_CORE_peer_get_info call. 420 * Context of our GNUNET_CORE_peer_change_preference call.
421 */ 421 */
422 struct GNUNET_CORE_InformationRequestContext *irc; 422 struct GNUNET_CORE_InformationRequestContext *irc;
423 423
@@ -1770,8 +1770,6 @@ transmit_request_cb (void *cls,
1770 * 1770 *
1771 * @param cls the requests "struct PendingRequest*" 1771 * @param cls the requests "struct PendingRequest*"
1772 * @param peer identifies the peer 1772 * @param peer identifies the peer
1773 * @param latency current latency estimate, "FOREVER" if we have been
1774 * disconnected
1775 * @param bpm_in set to the current bandwidth limit (receiving) for this peer 1773 * @param bpm_in set to the current bandwidth limit (receiving) for this peer
1776 * @param bpm_out set to the current bandwidth limit (sending) for this peer 1774 * @param bpm_out set to the current bandwidth limit (sending) for this peer
1777 * @param amount set to the amount that was actually reserved or unreserved 1775 * @param amount set to the amount that was actually reserved or unreserved
@@ -1783,9 +1781,8 @@ target_reservation_cb (void *cls,
1783 GNUNET_PeerIdentity * peer, 1781 GNUNET_PeerIdentity * peer,
1784 unsigned int bpm_in, 1782 unsigned int bpm_in,
1785 unsigned int bpm_out, 1783 unsigned int bpm_out,
1786 struct GNUNET_TIME_Relative 1784 int amount,
1787 latency, int amount, 1785 uint64_t preference)
1788 unsigned long long preference)
1789{ 1786{
1790 struct PendingRequest *pr = cls; 1787 struct PendingRequest *pr = cls;
1791 uint32_t priority; 1788 uint32_t priority;
@@ -1872,7 +1869,7 @@ forward_request_task (void *cls,
1872 } 1869 }
1873 /* (2) reserve reply bandwidth */ 1870 /* (2) reserve reply bandwidth */
1874 GNUNET_assert (NULL == pr->irc); 1871 GNUNET_assert (NULL == pr->irc);
1875 pr->irc = GNUNET_CORE_peer_get_info (sched, cfg, 1872 pr->irc = GNUNET_CORE_peer_change_preference (sched, cfg,
1876 &psc.target, 1873 &psc.target,
1877 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 1874 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
1878 -1, 1875 -1,
@@ -2222,7 +2219,7 @@ destroy_pending_request (struct PendingRequest *pr)
2222 // also, what does the return value mean? 2219 // also, what does the return value mean?
2223 if (pr->irc != NULL) 2220 if (pr->irc != NULL)
2224 { 2221 {
2225 GNUNET_CORE_peer_get_info_cancel (pr->irc); 2222 GNUNET_CORE_peer_change_preference_cancel (pr->irc);
2226 pr->irc = NULL; 2223 pr->irc = NULL;
2227 } 2224 }
2228 if (pr->client == NULL) 2225 if (pr->client == NULL)
@@ -2407,11 +2404,15 @@ destroy_request (void *cls,
2407 * 2404 *
2408 * @param cls closure, not used 2405 * @param cls closure, not used
2409 * @param peer peer identity this notification is about 2406 * @param peer peer identity this notification is about
2407 * @param latency reported latency of the connection with 'other'
2408 * @param distance reported distance (DV) to 'other'
2410 */ 2409 */
2411static void 2410static void
2412peer_connect_handler (void *cls, 2411peer_connect_handler (void *cls,
2413 const struct 2412 const struct
2414 GNUNET_PeerIdentity * peer) 2413 GNUNET_PeerIdentity * peer,
2414 struct GNUNET_TIME_Relative latency,
2415 uint32_t distance)
2415{ 2416{
2416 struct ConnectedPeer *cp; 2417 struct ConnectedPeer *cp;
2417 2418
@@ -2773,13 +2774,17 @@ bound_priority (uint32_t prio_in,
2773 * @param other the other peer involved (sender or receiver, NULL 2774 * @param other the other peer involved (sender or receiver, NULL
2774 * for loopback messages where we are both sender and receiver) 2775 * for loopback messages where we are both sender and receiver)
2775 * @param message the actual message 2776 * @param message the actual message
2777 * @param latency reported latency of the connection with 'other'
2778 * @param distance reported distance (DV) to 'other'
2776 * @return GNUNET_OK to keep the connection open, 2779 * @return GNUNET_OK to keep the connection open,
2777 * GNUNET_SYSERR to close it (signal serious error) 2780 * GNUNET_SYSERR to close it (signal serious error)
2778 */ 2781 */
2779static int 2782static int
2780handle_p2p_get (void *cls, 2783handle_p2p_get (void *cls,
2781 const struct GNUNET_PeerIdentity *other, 2784 const struct GNUNET_PeerIdentity *other,
2782 const struct GNUNET_MessageHeader *message) 2785 const struct GNUNET_MessageHeader *message,
2786 struct GNUNET_TIME_Relative latency,
2787 uint32_t distance)
2783{ 2788{
2784 uint16_t msize; 2789 uint16_t msize;
2785 const struct GetMessage *gm; 2790 const struct GetMessage *gm;
@@ -2923,10 +2928,10 @@ handle_p2p_get (void *cls,
2923 if (preference < QUERY_BANDWIDTH_VALUE) 2928 if (preference < QUERY_BANDWIDTH_VALUE)
2924 preference = QUERY_BANDWIDTH_VALUE; 2929 preference = QUERY_BANDWIDTH_VALUE;
2925 // FIXME: also reserve bandwidth for reply? 2930 // FIXME: also reserve bandwidth for reply?
2926 (void) GNUNET_CORE_peer_get_info (sched, cfg, 2931 (void) GNUNET_CORE_peer_change_preference (sched, cfg,
2927 other, 2932 other,
2928 GNUNET_TIME_UNIT_FOREVER_REL, 2933 GNUNET_TIME_UNIT_FOREVER_REL,
2929 0, 0, preference, NULL, NULL); 2934 0, 0, preference, NULL, NULL);
2930 if (0 != (pgc->policy & ROUTING_POLICY_ANSWER)) 2935 if (0 != (pgc->policy & ROUTING_POLICY_ANSWER))
2931 pgc->drq = queue_ds_request (BASIC_DATASTORE_REQUEST_DELAY, 2936 pgc->drq = queue_ds_request (BASIC_DATASTORE_REQUEST_DELAY,
2932 &ds_get_request, 2937 &ds_get_request,
@@ -3205,13 +3210,17 @@ check_sblock (const struct SBlock *sb,
3205 * @param other the other peer involved (sender or receiver, NULL 3210 * @param other the other peer involved (sender or receiver, NULL
3206 * for loopback messages where we are both sender and receiver) 3211 * for loopback messages where we are both sender and receiver)
3207 * @param message the actual message 3212 * @param message the actual message
3213 * @param latency reported latency of the connection with 'other'
3214 * @param distance reported distance (DV) to 'other'
3208 * @return GNUNET_OK to keep the connection open, 3215 * @return GNUNET_OK to keep the connection open,
3209 * GNUNET_SYSERR to close it (signal serious error) 3216 * GNUNET_SYSERR to close it (signal serious error)
3210 */ 3217 */
3211static int 3218static int
3212handle_p2p_put (void *cls, 3219handle_p2p_put (void *cls,
3213 const struct GNUNET_PeerIdentity *other, 3220 const struct GNUNET_PeerIdentity *other,
3214 const struct GNUNET_MessageHeader *message) 3221 const struct GNUNET_MessageHeader *message,
3222 struct GNUNET_TIME_Relative latency,
3223 uint32_t distance)
3215{ 3224{
3216 const struct PutMessage *put; 3225 const struct PutMessage *put;
3217 uint16_t msize; 3226 uint16_t msize;
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index d16869afd..ff93f4145 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -258,23 +258,11 @@ static struct DisconnectList *disconnect_tail;
258 * has completed. 258 * has completed.
259 * 259 *
260 * @param cls our 'struct DisconnectList' 260 * @param cls our 'struct DisconnectList'
261 * @param peer NULL on error (then what?) 261 * @param tc unused
262 * @param bpm_in set to the current bandwidth limit (receiving) for this peer
263 * @param bpm_out set to the current bandwidth limit (sending) for this peer
264 * @param latency current latency estimate, "FOREVER" if we have been
265 * disconnected
266 * @param amount set to the amount that was actually reserved or unreserved
267 * @param preference current traffic preference for the given peer
268 */ 262 */
269static void 263static void
270disconnect_done (void *cls, 264disconnect_done (void *cls,
271 const struct 265 const struct GNUNET_SCHEDULER_TaskContext *tc)
272 GNUNET_PeerIdentity * peer,
273 unsigned int bpm_in,
274 unsigned int bpm_out,
275 struct GNUNET_TIME_Relative
276 latency, int amount,
277 unsigned long long preference)
278{ 266{
279 struct DisconnectList *dl = cls; 267 struct DisconnectList *dl = cls;
280 268
@@ -620,11 +608,15 @@ reschedule_hellos (struct PeerList *peer)
620 * 608 *
621 * @param cls closure 609 * @param cls closure
622 * @param peer peer identity this notification is about 610 * @param peer peer identity this notification is about
611 * @param latency reported latency of the connection with 'other'
612 * @param distance reported distance (DV) to 'other'
623 */ 613 */
624static void 614static void
625connect_notify (void *cls, 615connect_notify (void *cls,
626 const struct 616 const struct
627 GNUNET_PeerIdentity * peer) 617 GNUNET_PeerIdentity * peer,
618 struct GNUNET_TIME_Relative latency,
619 uint32_t distance)
628{ 620{
629 struct PeerList *pos; 621 struct PeerList *pos;
630 622
@@ -1092,6 +1084,8 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
1092 * @param other the other peer involved (sender or receiver, NULL 1084 * @param other the other peer involved (sender or receiver, NULL
1093 * for loopback messages where we are both sender and receiver) 1085 * for loopback messages where we are both sender and receiver)
1094 * @param message the actual HELLO message 1086 * @param message the actual HELLO message
1087 * @param latency reported latency of the connection with 'other'
1088 * @param distance reported distance (DV) to 'other'
1095 * @return GNUNET_OK to keep the connection open, 1089 * @return GNUNET_OK to keep the connection open,
1096 * GNUNET_SYSERR to close it (signal serious error) 1090 * GNUNET_SYSERR to close it (signal serious error)
1097 */ 1091 */
@@ -1099,7 +1093,9 @@ static int
1099handle_encrypted_hello (void *cls, 1093handle_encrypted_hello (void *cls,
1100 const struct GNUNET_PeerIdentity * other, 1094 const struct GNUNET_PeerIdentity * other,
1101 const struct GNUNET_MessageHeader * 1095 const struct GNUNET_MessageHeader *
1102 message) 1096 message,
1097 struct GNUNET_TIME_Relative latency,
1098 uint32_t distance)
1103{ 1099{
1104#if DEBUG_TOPOLOGY 1100#if DEBUG_TOPOLOGY
1105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1213,7 +1209,7 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1213 GNUNET_CONTAINER_DLL_remove (disconnect_head, 1209 GNUNET_CONTAINER_DLL_remove (disconnect_head,
1214 disconnect_tail, 1210 disconnect_tail,
1215 dl); 1211 dl);
1216 GNUNET_CORE_peer_get_info_cancel (dl->rh); 1212 GNUNET_CORE_peer_request_cancel (dl->rh);
1217 GNUNET_free (dl); 1213 GNUNET_free (dl);
1218 } 1214 }
1219} 1215}