diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
commit | 16a6919a9f98ee9fa1fee9dd262906c321004a19 (patch) | |
tree | e09d4fe5191dc329b3e1b667f2914f8313bcba59 /src/core/gnunet-service-core.c | |
parent | 4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff) | |
download | gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip |
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src/core/gnunet-service-core.c')
-rw-r--r-- | src/core/gnunet-service-core.c | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index e97e9fe46..7385991a2 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -1807,7 +1807,8 @@ free_neighbour (struct Neighbour *n) | |||
1807 | * | 1807 | * |
1808 | * @param n neighbour to check. | 1808 | * @param n neighbour to check. |
1809 | */ | 1809 | */ |
1810 | static void process_encrypted_neighbour_queue (struct Neighbour *n); | 1810 | static void |
1811 | process_encrypted_neighbour_queue (struct Neighbour *n); | ||
1811 | 1812 | ||
1812 | 1813 | ||
1813 | /** | 1814 | /** |
@@ -1854,7 +1855,8 @@ do_encrypt (struct Neighbour *n, | |||
1854 | * | 1855 | * |
1855 | * @param n neighbour to consider discarding | 1856 | * @param n neighbour to consider discarding |
1856 | */ | 1857 | */ |
1857 | static void consider_free_neighbour (struct Neighbour *n); | 1858 | static void |
1859 | consider_free_neighbour (struct Neighbour *n); | ||
1858 | 1860 | ||
1859 | 1861 | ||
1860 | /** | 1862 | /** |
@@ -2006,9 +2008,9 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) | |||
2006 | #if DEBUG_CORE | 2008 | #if DEBUG_CORE |
2007 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2009 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2008 | "Copied message of type %u and size %u into transport buffer for `%4s'\n", | 2010 | "Copied message of type %u and size %u into transport buffer for `%4s'\n", |
2009 | (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])-> | 2011 | (unsigned int) |
2010 | type), (unsigned int) ret, | 2012 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), |
2011 | GNUNET_i2s (&n->peer)); | 2013 | (unsigned int) ret, GNUNET_i2s (&n->peer)); |
2012 | #endif | 2014 | #endif |
2013 | process_encrypted_neighbour_queue (n); | 2015 | process_encrypted_neighbour_queue (n); |
2014 | } | 2016 | } |
@@ -2017,8 +2019,9 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) | |||
2017 | #if DEBUG_CORE | 2019 | #if DEBUG_CORE |
2018 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2020 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2019 | "Transmission of message of type %u and size %u failed\n", | 2021 | "Transmission of message of type %u and size %u failed\n", |
2020 | (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])-> | 2022 | (unsigned int) |
2021 | type), (unsigned int) m->size); | 2023 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), |
2024 | (unsigned int) m->size); | ||
2022 | #endif | 2025 | #endif |
2023 | } | 2026 | } |
2024 | GNUNET_free (m); | 2027 | GNUNET_free (m); |
@@ -2038,7 +2041,8 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) | |||
2038 | * | 2041 | * |
2039 | * @param n neighbour to check. | 2042 | * @param n neighbour to check. |
2040 | */ | 2043 | */ |
2041 | static void process_plaintext_neighbour_queue (struct Neighbour *n); | 2044 | static void |
2045 | process_plaintext_neighbour_queue (struct Neighbour *n); | ||
2042 | 2046 | ||
2043 | 2047 | ||
2044 | /** | 2048 | /** |
@@ -2071,9 +2075,8 @@ process_encrypted_neighbour_queue (struct Neighbour *n) | |||
2071 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2075 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2072 | "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", | 2076 | "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", |
2073 | (unsigned int) m->size, GNUNET_i2s (&n->peer), | 2077 | (unsigned int) m->size, GNUNET_i2s (&n->peer), |
2074 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (m-> | 2078 | (unsigned long long) |
2075 | deadline). | 2079 | GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value); |
2076 | rel_value); | ||
2077 | #endif | 2080 | #endif |
2078 | n->th = | 2081 | n->th = |
2079 | GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, | 2082 | GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, |
@@ -2436,8 +2439,8 @@ batch_message (struct Neighbour *n, char *buf, size_t size, | |||
2436 | (unsigned int) | 2439 | (unsigned int) |
2437 | ntohs (((const struct GNUNET_MessageHeader *) &pos[1])->type), | 2440 | ntohs (((const struct GNUNET_MessageHeader *) &pos[1])->type), |
2438 | (unsigned int) | 2441 | (unsigned int) |
2439 | ntohs (((const struct GNUNET_MessageHeader *) &pos[1])-> | 2442 | ntohs (((const struct GNUNET_MessageHeader *) |
2440 | size)); | 2443 | &pos[1])->size)); |
2441 | #endif | 2444 | #endif |
2442 | /* copy for encrypted transmission */ | 2445 | /* copy for encrypted transmission */ |
2443 | memcpy (&buf[ret], &pos[1], pos->size); | 2446 | memcpy (&buf[ret], &pos[1], pos->size); |
@@ -2448,9 +2451,8 @@ batch_message (struct Neighbour *n, char *buf, size_t size, | |||
2448 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2451 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2449 | "Adding plaintext message of size %u with deadline %llu ms to batch\n", | 2452 | "Adding plaintext message of size %u with deadline %llu ms to batch\n", |
2450 | (unsigned int) pos->size, | 2453 | (unsigned int) pos->size, |
2451 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (pos-> | 2454 | (unsigned long long) |
2452 | deadline). | 2455 | GNUNET_TIME_absolute_get_remaining (pos->deadline).rel_value); |
2453 | rel_value); | ||
2454 | #endif | 2456 | #endif |
2455 | deadline->abs_value = | 2457 | deadline->abs_value = |
2456 | GNUNET_MIN (deadline->abs_value, pos->deadline.abs_value); | 2458 | GNUNET_MIN (deadline->abs_value, pos->deadline.abs_value); |
@@ -2548,7 +2550,8 @@ retry_plaintext_processing (void *cls, | |||
2548 | * | 2550 | * |
2549 | * @param n the other peer | 2551 | * @param n the other peer |
2550 | */ | 2552 | */ |
2551 | static void send_key (struct Neighbour *n); | 2553 | static void |
2554 | send_key (struct Neighbour *n); | ||
2552 | 2555 | ||
2553 | /** | 2556 | /** |
2554 | * Task that will retry "send_key" if our previous attempt failed | 2557 | * Task that will retry "send_key" if our previous attempt failed |
@@ -2734,9 +2737,9 @@ process_plaintext_neighbour_queue (struct Neighbour *n) | |||
2734 | * @param cls neighbour for the quota update | 2737 | * @param cls neighbour for the quota update |
2735 | * @param tc context | 2738 | * @param tc context |
2736 | */ | 2739 | */ |
2737 | static void neighbour_quota_update (void *cls, | 2740 | static void |
2738 | const struct GNUNET_SCHEDULER_TaskContext | 2741 | neighbour_quota_update (void *cls, |
2739 | *tc); | 2742 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
2740 | 2743 | ||
2741 | 2744 | ||
2742 | /** | 2745 | /** |
@@ -3269,9 +3272,9 @@ send_key (struct Neighbour *n) | |||
3269 | #if DEBUG_CORE | 3272 | #if DEBUG_CORE |
3270 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3273 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3271 | "Have %llu ms left for `%s' transmission.\n", | 3274 | "Have %llu ms left for `%s' transmission.\n", |
3272 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (me-> | 3275 | (unsigned long long) |
3273 | deadline). | 3276 | GNUNET_TIME_absolute_get_remaining (me->deadline).rel_value, |
3274 | rel_value, "SET_KEY"); | 3277 | "SET_KEY"); |
3275 | #endif | 3278 | #endif |
3276 | trigger_processing: | 3279 | trigger_processing: |
3277 | /* trigger queue processing */ | 3280 | /* trigger queue processing */ |
@@ -3293,9 +3296,10 @@ trigger_processing: | |||
3293 | * @param ats performance data | 3296 | * @param ats performance data |
3294 | * @param ats_count number of entries in ats (excluding 0-termination) | 3297 | * @param ats_count number of entries in ats (excluding 0-termination) |
3295 | */ | 3298 | */ |
3296 | static void handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m, | 3299 | static void |
3297 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | 3300 | handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m, |
3298 | uint32_t ats_count); | 3301 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
3302 | uint32_t ats_count); | ||
3299 | 3303 | ||
3300 | 3304 | ||
3301 | 3305 | ||
@@ -3843,8 +3847,8 @@ send_p2p_message_to_client (struct Neighbour *sender, struct Client *client, | |||
3843 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3847 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3844 | "Core service passes message from `%4s' of type %u to client.\n", | 3848 | "Core service passes message from `%4s' of type %u to client.\n", |
3845 | GNUNET_i2s (&sender->peer), | 3849 | GNUNET_i2s (&sender->peer), |
3846 | (unsigned int) ntohs (((const struct GNUNET_MessageHeader *) m)-> | 3850 | (unsigned int) |
3847 | type)); | 3851 | ntohs (((const struct GNUNET_MessageHeader *) m)->type)); |
3848 | #endif | 3852 | #endif |
3849 | ntm = (struct NotifyTrafficMessage *) buf; | 3853 | ntm = (struct NotifyTrafficMessage *) buf; |
3850 | ntm->header.size = htons (size); | 3854 | ntm->header.size = htons (size); |