diff options
-rw-r--r-- | src/core/gnunet-service-core.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index d0fd6893e..32b39fd7f 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -2553,8 +2553,7 @@ handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m) | |||
2553 | 2553 | ||
2554 | 2554 | ||
2555 | /** | 2555 | /** |
2556 | * We received a PONG message. Validate and update | 2556 | * We received a PONG message. Validate and update our status. |
2557 | * our status. | ||
2558 | * | 2557 | * |
2559 | * @param n sender of the PONG | 2558 | * @param n sender of the PONG |
2560 | * @param m the encrypted PONG message itself | 2559 | * @param m the encrypted PONG message itself |
@@ -2619,9 +2618,8 @@ handle_pong (struct Neighbour *n, const struct PingMessage *m) | |||
2619 | } | 2618 | } |
2620 | cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); | 2619 | cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); |
2621 | cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT); | 2620 | cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT); |
2622 | cnm.distance = htonl (0); /* FIXME */ | 2621 | cnm.distance = htonl (n->last_distance); |
2623 | cnm.latency = GNUNET_TIME_relative_hton (GNUNET_TIME_UNIT_ZERO); /* FIXME */ | 2622 | cnm.latency = GNUNET_TIME_relative_hton (n->last_latency); |
2624 | cnm.reserved = htonl (0); | ||
2625 | cnm.peer = n->peer; | 2623 | cnm.peer = n->peer; |
2626 | send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_CONNECT); | 2624 | send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_CONNECT); |
2627 | process_encrypted_neighbour_queue (n); | 2625 | process_encrypted_neighbour_queue (n); |
@@ -2661,7 +2659,8 @@ send_p2p_message_to_client (struct Neighbour *sender, | |||
2661 | ntm = (struct NotifyTrafficMessage *) buf; | 2659 | ntm = (struct NotifyTrafficMessage *) buf; |
2662 | ntm->header.size = htons (msize + sizeof (struct NotifyTrafficMessage)); | 2660 | ntm->header.size = htons (msize + sizeof (struct NotifyTrafficMessage)); |
2663 | ntm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND); | 2661 | ntm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND); |
2664 | ntm->reserved = htonl (0); | 2662 | ntm->distance = htonl (sender->last_distance); |
2663 | ntm->latency = GNUNET_TIME_relative_hton (sender->last_latency); | ||
2665 | ntm->peer = sender->peer; | 2664 | ntm->peer = sender->peer; |
2666 | memcpy (&ntm[1], m, msize); | 2665 | memcpy (&ntm[1], m, msize); |
2667 | send_to_client (client, &ntm->header, GNUNET_YES); | 2666 | send_to_client (client, &ntm->header, GNUNET_YES); |
@@ -3128,7 +3127,8 @@ handle_transport_notify_connect (void *cls, | |||
3128 | schedule_quota_update (n); | 3127 | schedule_quota_update (n); |
3129 | cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); | 3128 | cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); |
3130 | cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_PRE_CONNECT); | 3129 | cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_PRE_CONNECT); |
3131 | cnm.reserved = htonl (0); | 3130 | cnm.distance = htonl (n->last_distance); |
3131 | cnm.latency = GNUNET_TIME_relative_hton (n->last_latency); | ||
3132 | cnm.peer = *peer; | 3132 | cnm.peer = *peer; |
3133 | send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_PRE_CONNECT); | 3133 | send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_PRE_CONNECT); |
3134 | send_key (n); | 3134 | send_key (n); |
@@ -3191,7 +3191,7 @@ static void | |||
3191 | handle_transport_notify_disconnect (void *cls, | 3191 | handle_transport_notify_disconnect (void *cls, |
3192 | const struct GNUNET_PeerIdentity *peer) | 3192 | const struct GNUNET_PeerIdentity *peer) |
3193 | { | 3193 | { |
3194 | struct ConnectNotifyMessage cnm; | 3194 | struct DisconnectNotifyMessage cnm; |
3195 | struct Neighbour *n; | 3195 | struct Neighbour *n; |
3196 | struct Neighbour *p; | 3196 | struct Neighbour *p; |
3197 | 3197 | ||
@@ -3218,9 +3218,8 @@ handle_transport_notify_disconnect (void *cls, | |||
3218 | p->next = n->next; | 3218 | p->next = n->next; |
3219 | GNUNET_assert (neighbour_count > 0); | 3219 | GNUNET_assert (neighbour_count > 0); |
3220 | neighbour_count--; | 3220 | neighbour_count--; |
3221 | cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); | 3221 | cnm.header.size = htons (sizeof (struct DisconnectNotifyMessage)); |
3222 | cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT); | 3222 | cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT); |
3223 | cnm.reserved = htonl (0); | ||
3224 | cnm.peer = *peer; | 3223 | cnm.peer = *peer; |
3225 | send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_DISCONNECT); | 3224 | send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_DISCONNECT); |
3226 | free_neighbour (n); | 3225 | free_neighbour (n); |