summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_manipulation.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-09-16 15:10:51 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-09-16 15:10:51 +0000
commit64bc1ae7763fd4f4e2ad4fb7acb4a1a2292bf988 (patch)
treee563e1dcbd7c8251438415558bc2869076f77b94 /src/transport/gnunet-service-transport_manipulation.c
parent75633a91d79403d921ef534bbb462697ce275733 (diff)
fixing indent
Diffstat (limited to 'src/transport/gnunet-service-transport_manipulation.c')
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index f66d15d82..0ebe18c55 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -407,68 +407,68 @@ GST_manipulation_send (const struct GNUNET_PeerIdentity *target, const void *msg
size_t msg_size, struct GNUNET_TIME_Relative timeout,
GST_NeighbourSendContinuation cont, void *cont_cls)
{
- struct TM_Peer *tmp;
- struct DelayQueueEntry *dqe;
- struct GNUNET_TIME_Relative delay;
+ struct TM_Peer *tmp;
+ struct DelayQueueEntry *dqe;
+ struct GNUNET_TIME_Relative delay;
- if (NULL != (tmp = GNUNET_CONTAINER_multihashmap_get (man_handle.peers, &target->hashPubKey)))
- {
- GNUNET_break (GNUNET_YES == GST_neighbours_test_connected(target));
- /* Manipulate here */
- /* Delay */
- if (UINT32_MAX != find_metric(tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND))
- {
- /* We have a delay */
- delay.rel_value_us = find_metric (tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND);
- dqe = GNUNET_malloc (sizeof (struct DelayQueueEntry) + msg_size);
- dqe->id = *target;
- dqe->tmp = tmp;
- dqe->sent_at = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(), delay);
- dqe->cont = cont;
- dqe->cont_cls = cont_cls;
- dqe->msg = &dqe[1];
- dqe->msg_size = msg_size;
- dqe->timeout = timeout;
- memcpy (dqe->msg, msg, msg_size);
- GNUNET_CONTAINER_DLL_insert_tail (tmp->send_head, tmp->send_tail, dqe);
- if (GNUNET_SCHEDULER_NO_TASK == tmp->send_delay_task)
- tmp->send_delay_task =GNUNET_SCHEDULER_add_delayed (delay, &send_delayed, dqe);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Delaying %u byte message to peer `%s' with generic delay for %ms\n",
- msg_size, GNUNET_i2s (target),
- GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
- return;
- }
- }
- else if (UINT32_MAX != find_metric (&man_handle.general, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND))
- {
- GNUNET_break (GNUNET_YES == GST_neighbours_test_connected(target));
- /* We have a delay */
- delay.rel_value_us = find_metric (&man_handle.general, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND);
- dqe = GNUNET_malloc (sizeof (struct DelayQueueEntry) + msg_size);
- dqe->id = *target;
- dqe->tmp = NULL;
- dqe->sent_at = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(), delay);
- dqe->cont = cont;
- dqe->cont_cls = cont_cls;
- dqe->msg = &dqe[1];
- dqe->msg_size = msg_size;
- dqe->timeout = timeout;
- memcpy (dqe->msg, msg, msg_size);
- GNUNET_CONTAINER_DLL_insert_tail (generic_dqe_head, generic_dqe_tail, dqe);
- if (GNUNET_SCHEDULER_NO_TASK == generic_send_delay_task)
- {
- generic_send_delay_task = GNUNET_SCHEDULER_add_delayed (delay, &send_delayed, dqe);
- }
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Delaying %u byte message to peer `%s' with peer specific delay for %s\n",
- msg_size, GNUNET_i2s (target),
- GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
- return;
- }
+ if (NULL != (tmp = GNUNET_CONTAINER_multihashmap_get (man_handle.peers, &target->hashPubKey)))
+ {
+ GNUNET_break (GNUNET_YES == GST_neighbours_test_connected(target));
+ /* Manipulate here */
+ /* Delay */
+ if (UINT32_MAX != find_metric(tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND))
+ {
+ /* We have a delay */
+ delay.rel_value_us = find_metric (tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND);
+ dqe = GNUNET_malloc (sizeof (struct DelayQueueEntry) + msg_size);
+ dqe->id = *target;
+ dqe->tmp = tmp;
+ dqe->sent_at = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(), delay);
+ dqe->cont = cont;
+ dqe->cont_cls = cont_cls;
+ dqe->msg = &dqe[1];
+ dqe->msg_size = msg_size;
+ dqe->timeout = timeout;
+ memcpy (dqe->msg, msg, msg_size);
+ GNUNET_CONTAINER_DLL_insert_tail (tmp->send_head, tmp->send_tail, dqe);
+ if (GNUNET_SCHEDULER_NO_TASK == tmp->send_delay_task)
+ tmp->send_delay_task =GNUNET_SCHEDULER_add_delayed (delay, &send_delayed, dqe);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Delaying %u byte message to peer `%s' with generic delay for %ms\n",
+ msg_size, GNUNET_i2s (target),
+ GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
+ return;
+ }
+ }
+ else if (UINT32_MAX != find_metric (&man_handle.general, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND))
+ {
+ GNUNET_break (GNUNET_YES == GST_neighbours_test_connected(target));
+ /* We have a delay */
+ delay.rel_value_us = find_metric (&man_handle.general, GNUNET_ATS_QUALITY_NET_DELAY, TM_SEND);
+ dqe = GNUNET_malloc (sizeof (struct DelayQueueEntry) + msg_size);
+ dqe->id = *target;
+ dqe->tmp = NULL;
+ dqe->sent_at = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(), delay);
+ dqe->cont = cont;
+ dqe->cont_cls = cont_cls;
+ dqe->msg = &dqe[1];
+ dqe->msg_size = msg_size;
+ dqe->timeout = timeout;
+ memcpy (dqe->msg, msg, msg_size);
+ GNUNET_CONTAINER_DLL_insert_tail (generic_dqe_head, generic_dqe_tail, dqe);
+ if (GNUNET_SCHEDULER_NO_TASK == generic_send_delay_task)
+ {
+ generic_send_delay_task = GNUNET_SCHEDULER_add_delayed (delay, &send_delayed, dqe);
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Delaying %u byte message to peer `%s' with peer specific delay for %s\n",
+ msg_size, GNUNET_i2s (target),
+ GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
+ return;
+ }
- /* Normal sending */
- GST_neighbours_send (target, msg, msg_size, timeout, cont, cont_cls);
+ /* Normal sending */
+ GST_neighbours_send (target, msg, msg_size, timeout, cont, cont_cls);
}