diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-27 21:46:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-27 21:46:41 +0000 |
commit | 46a63dc665f31fa7d42639ab6adabbdb1af239c8 (patch) | |
tree | 6c3e58a7f57d6d3ee44aa6cd2808b5458d75de4b /src/dv | |
parent | 4848a679018f9e864cd277345191ad8f1000b5ff (diff) | |
download | gnunet-46a63dc665f31fa7d42639ab6adabbdb1af239c8.tar.gz gnunet-46a63dc665f31fa7d42639ab6adabbdb1af239c8.zip |
renaming GNUNET_TIME_relative_get_forever and GNUNET_TIME_absolute_get_forever methods, adding underscore, to make it clear that the respective #defines should be used instead; replacing use of direct function calls with respective macros where applicable; adding additional GNUNET_TIME_relative_get_xxx-functions to avoid calls to GNUNET_TIME_relative_multiply, which turn out to have gotten performance-relevant
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/gnunet-service-dv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 651b92ac0..ecf574e20 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -1334,7 +1334,7 @@ send_message_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1334 | { | 1334 | { |
1335 | send_message (&msg_ctx->dest, &msg_ctx->sender, NULL, msg_ctx->message, | 1335 | send_message (&msg_ctx->dest, &msg_ctx->sender, NULL, msg_ctx->message, |
1336 | msg_ctx->message_size, default_dv_priority, msg_ctx->uid, | 1336 | msg_ctx->message_size, default_dv_priority, msg_ctx->uid, |
1337 | GNUNET_TIME_relative_get_forever ()); | 1337 | GNUNET_TIME_UNIT_FOREVER_REL); |
1338 | GNUNET_free (msg_ctx->message); | 1338 | GNUNET_free (msg_ctx->message); |
1339 | GNUNET_free (msg_ctx); | 1339 | GNUNET_free (msg_ctx); |
1340 | } | 1340 | } |
@@ -1629,7 +1629,7 @@ handle_dv_data_message (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1629 | send_message (destination, original_sender, NULL, packed_message, | 1629 | send_message (destination, original_sender, NULL, packed_message, |
1630 | packed_message_size, default_dv_priority, | 1630 | packed_message_size, default_dv_priority, |
1631 | ntohl (incoming->uid), | 1631 | ntohl (incoming->uid), |
1632 | GNUNET_TIME_relative_get_forever ()); | 1632 | GNUNET_TIME_UNIT_FOREVER_REL); |
1633 | } | 1633 | } |
1634 | if (ret != GNUNET_SYSERR) | 1634 | if (ret != GNUNET_SYSERR) |
1635 | return GNUNET_OK; | 1635 | return GNUNET_OK; |
@@ -1764,7 +1764,7 @@ neighbor_send_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1764 | sizeof (p2p_dv_MESSAGE_NeighborInfo)); | 1764 | sizeof (p2p_dv_MESSAGE_NeighborInfo)); |
1765 | pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1]; | 1765 | pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1]; |
1766 | pending_message->importance = default_dv_priority; | 1766 | pending_message->importance = default_dv_priority; |
1767 | pending_message->timeout = GNUNET_TIME_relative_get_forever (); | 1767 | pending_message->timeout = GNUNET_TIME_UNIT_FOREVER_REL; |
1768 | memcpy (&pending_message->recipient, &to->identity, | 1768 | memcpy (&pending_message->recipient, &to->identity, |
1769 | sizeof (struct GNUNET_PeerIdentity)); | 1769 | sizeof (struct GNUNET_PeerIdentity)); |
1770 | pending_message->msg_size = sizeof (p2p_dv_MESSAGE_NeighborInfo); | 1770 | pending_message->msg_size = sizeof (p2p_dv_MESSAGE_NeighborInfo); |
@@ -1784,7 +1784,7 @@ neighbor_send_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1784 | 1784 | ||
1785 | GNUNET_SCHEDULER_add_now (try_core_send, NULL); | 1785 | GNUNET_SCHEDULER_add_now (try_core_send, NULL); |
1786 | /*if (core_transmit_handle == NULL) | 1786 | /*if (core_transmit_handle == NULL) |
1787 | * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES, default_dv_priority, GNUNET_TIME_relative_get_forever(), &to->identity, sizeof(p2p_dv_MESSAGE_NeighborInfo), &core_transmit_notify, NULL); */ | 1787 | * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES, default_dv_priority, GNUNET_TIME_UNIT_FOREVER_REL, &to->identity, sizeof(p2p_dv_MESSAGE_NeighborInfo), &core_transmit_notify, NULL); */ |
1788 | 1788 | ||
1789 | } | 1789 | } |
1790 | 1790 | ||
@@ -2193,7 +2193,7 @@ schedule_disconnect_messages (void *cls, const GNUNET_HashCode * key, | |||
2193 | sizeof (p2p_dv_MESSAGE_Disconnect)); | 2193 | sizeof (p2p_dv_MESSAGE_Disconnect)); |
2194 | pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1]; | 2194 | pending_message->msg = (struct GNUNET_MessageHeader *) &pending_message[1]; |
2195 | pending_message->importance = default_dv_priority; | 2195 | pending_message->importance = default_dv_priority; |
2196 | pending_message->timeout = GNUNET_TIME_relative_get_forever (); | 2196 | pending_message->timeout = GNUNET_TIME_UNIT_FOREVER_REL; |
2197 | memcpy (&pending_message->recipient, ¬ify->identity, | 2197 | memcpy (&pending_message->recipient, ¬ify->identity, |
2198 | sizeof (struct GNUNET_PeerIdentity)); | 2198 | sizeof (struct GNUNET_PeerIdentity)); |
2199 | pending_message->msg_size = sizeof (p2p_dv_MESSAGE_Disconnect); | 2199 | pending_message->msg_size = sizeof (p2p_dv_MESSAGE_Disconnect); |
@@ -2207,7 +2207,7 @@ schedule_disconnect_messages (void *cls, const GNUNET_HashCode * key, | |||
2207 | 2207 | ||
2208 | GNUNET_SCHEDULER_add_now (try_core_send, NULL); | 2208 | GNUNET_SCHEDULER_add_now (try_core_send, NULL); |
2209 | /*if (core_transmit_handle == NULL) | 2209 | /*if (core_transmit_handle == NULL) |
2210 | * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES, default_dv_priority, GNUNET_TIME_relative_get_forever(), ¬ify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify, NULL); */ | 2210 | * core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES, default_dv_priority, GNUNET_TIME_UNIT_FOREVER_REL, ¬ify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify, NULL); */ |
2211 | 2211 | ||
2212 | return GNUNET_YES; | 2212 | return GNUNET_YES; |
2213 | } | 2213 | } |