[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35230 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35230 - gnunet/src/ats |
Date: |
Wed, 11 Feb 2015 19:29:55 +0100 |
Author: grothoff
Date: 2015-02-11 19:29:54 +0100 (Wed, 11 Feb 2015)
New Revision: 35230
Modified:
gnunet/src/ats/gnunet-service-ats_reservations.c
gnunet/src/ats/gnunet-service-ats_reservations.h
Log:
-remove unused exported symbol
Modified: gnunet/src/ats/gnunet-service-ats_reservations.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_reservations.c 2015-02-11 17:10:31 UTC
(rev 35229)
+++ gnunet/src/ats/gnunet-service-ats_reservations.c 2015-02-11 18:29:54 UTC
(rev 35230)
@@ -51,16 +51,22 @@
* peer is not connected, otherwise the time to wait
* until the reservation might succeed
*/
-struct GNUNET_TIME_Relative
-GAS_reservations_reserve (const struct GNUNET_PeerIdentity *peer,
- int32_t amount)
+static struct GNUNET_TIME_Relative
+reservations_reserve (const struct GNUNET_PeerIdentity *peer,
+ int32_t amount)
{
struct GNUNET_BANDWIDTH_Tracker *tracker;
struct GNUNET_TIME_Relative ret;
- tracker = GNUNET_CONTAINER_multipeermap_get (trackers, peer);
+ tracker = GNUNET_CONTAINER_multipeermap_get (trackers,
+ peer);
if (NULL == tracker)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Not connected, allowing reservation of %d bytes\n",
+ (int) amount);
return GNUNET_TIME_UNIT_ZERO; /* not connected, satisfy now */
+ }
if (amount >= 0)
{
ret = GNUNET_BANDWIDTH_tracker_get_delay (tracker, amount);
@@ -75,7 +81,9 @@
}
}
(void) GNUNET_BANDWIDTH_tracker_consume (tracker, amount);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reserved %d bytes\n", (int) amount);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Reserved %d bytes\n",
+ (int) amount);
return GNUNET_TIME_UNIT_ZERO;
}
@@ -112,11 +120,14 @@
GNUNET_BANDWIDTH_tracker_init (tracker, NULL, NULL, bandwidth_in,
MAX_BANDWIDTH_CARRY_S);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multipeermap_put (trackers, peer, tracker,
+ GNUNET_CONTAINER_multipeermap_put (trackers,
+ peer,
+ tracker,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
return;
}
- GNUNET_BANDWIDTH_tracker_update_quota (tracker, bandwidth_in);
+ GNUNET_BANDWIDTH_tracker_update_quota (tracker,
+ bandwidth_in);
}
@@ -149,7 +160,7 @@
return;
}
amount = (int32_t) ntohl (msg->amount);
- res_delay = GAS_reservations_reserve (&msg->peer, amount);
+ res_delay = reservations_reserve (&msg->peer, amount);
if (res_delay.rel_value_us > 0)
amount = 0;
result.header.size = htons (sizeof (struct ReservationResultMessage));
@@ -179,7 +190,8 @@
void
GAS_reservations_init (struct GNUNET_SERVER_Handle *server)
{
- trackers = GNUNET_CONTAINER_multipeermap_create (128, GNUNET_NO);
+ trackers = GNUNET_CONTAINER_multipeermap_create (128,
+ GNUNET_NO);
}
Modified: gnunet/src/ats/gnunet-service-ats_reservations.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_reservations.h 2015-02-11 17:10:31 UTC
(rev 35229)
+++ gnunet/src/ats/gnunet-service-ats_reservations.h 2015-02-11 18:29:54 UTC
(rev 35230)
@@ -44,22 +44,6 @@
/**
- * Reserve the given amount of incoming bandwidth (in bytes) from the
- * given peer. If a reservation is not possible right now, return how
- * long the client should wait before trying again.
- *
- * @param peer peer to reserve bandwidth from
- * @param amount number of bytes to reserve
- * @return 0 if the reservation was successful, FOREVER if the
- * peer is not connected, otherwise the time to wait
- * until the reservation might succeed
- */
-struct GNUNET_TIME_Relative
-GAS_reservations_reserve (const struct GNUNET_PeerIdentity *peer,
- int32_t amount);
-
-
-/**
* Handle 'reservation request' messages from clients.
*
* @param cls unused, NULL
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35230 - gnunet/src/ats,
gnunet <=