diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-02-05 11:57:24 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-02-05 11:57:24 +0000 |
commit | 9c17aecfc6bd795b24f8e4f0db0a1758826464d1 (patch) | |
tree | d34219a4ad7605ad2acf512489fd611d354f813e /src/transport | |
parent | 80ab6f6eb81c2f2f646a24dbdb8e15da5abe5cf4 (diff) | |
download | gnunet-9c17aecfc6bd795b24f8e4f0db0a1758826464d1.tar.gz gnunet-9c17aecfc6bd795b24f8e4f0db0a1758826464d1.zip |
missing frees
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 9d098b6da..d2168e4ac 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -855,6 +855,12 @@ update_quota (struct NeighborList *n) | |||
855 | if (delta.value < MIN_QUOTA_REFRESH_TIME) | 855 | if (delta.value < MIN_QUOTA_REFRESH_TIME) |
856 | return; /* not enough time passed for doing quota update */ | 856 | return; /* not enough time passed for doing quota update */ |
857 | allowed = delta.value * n->quota_in; | 857 | allowed = delta.value * n->quota_in; |
858 | |||
859 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING | | ||
860 | GNUNET_ERROR_TYPE_BULK, | ||
861 | _ | ||
862 | ("Update quota: last received is %u, allowed is %u\n"), n->last_received, allowed); | ||
863 | |||
858 | if (n->last_received < allowed) | 864 | if (n->last_received < allowed) |
859 | { | 865 | { |
860 | remaining = allowed - n->last_received; | 866 | remaining = allowed - n->last_received; |
@@ -1107,6 +1113,7 @@ transmit_send_continuation (void *cls, | |||
1107 | transmit_to_client (mq->client, &send_ok_msg.header, GNUNET_NO); | 1113 | transmit_to_client (mq->client, &send_ok_msg.header, GNUNET_NO); |
1108 | } | 1114 | } |
1109 | GNUNET_free (mq->message_buf); | 1115 | GNUNET_free (mq->message_buf); |
1116 | GNUNET_free (mq->neighbor_id); | ||
1110 | GNUNET_free (mq); | 1117 | GNUNET_free (mq); |
1111 | /* one plugin just became ready again, try transmitting | 1118 | /* one plugin just became ready again, try transmitting |
1112 | another message (if available) */ | 1119 | another message (if available) */ |
@@ -2251,6 +2258,7 @@ disconnect_neighbor (struct NeighborList *current_handle, int check) | |||
2251 | struct NeighborList *n; | 2258 | struct NeighborList *n; |
2252 | struct MessageQueue *mq; | 2259 | struct MessageQueue *mq; |
2253 | struct PeerAddressList *peer_addresses; | 2260 | struct PeerAddressList *peer_addresses; |
2261 | struct PeerAddressList *peer_pos; | ||
2254 | 2262 | ||
2255 | if (neighbors == NULL) | 2263 | if (neighbors == NULL) |
2256 | return; /* We don't have any neighbors, so client has an already removed handle! */ | 2264 | return; /* We don't have any neighbors, so client has an already removed handle! */ |
@@ -2308,6 +2316,16 @@ disconnect_neighbor (struct NeighborList *current_handle, int check) | |||
2308 | GNUNET_assert (rpos->neighbor == n); | 2316 | GNUNET_assert (rpos->neighbor == n); |
2309 | if (GNUNET_YES == rpos->connected) | 2317 | if (GNUNET_YES == rpos->connected) |
2310 | rpos->plugin->api->disconnect (rpos->plugin->api->cls, &n->id); | 2318 | rpos->plugin->api->disconnect (rpos->plugin->api->cls, &n->id); |
2319 | |||
2320 | peer_pos = rpos->addresses; | ||
2321 | rpos->addresses = peer_pos->next; | ||
2322 | while (peer_pos != NULL) | ||
2323 | { | ||
2324 | GNUNET_free(peer_pos); | ||
2325 | GNUNET_free(peer_pos->addr); | ||
2326 | peer_pos = rpos->addresses; | ||
2327 | rpos->addresses = peer_pos->next; | ||
2328 | } | ||
2311 | GNUNET_free (rpos); | 2329 | GNUNET_free (rpos); |
2312 | } | 2330 | } |
2313 | 2331 | ||
@@ -2316,6 +2334,7 @@ disconnect_neighbor (struct NeighborList *current_handle, int check) | |||
2316 | { | 2334 | { |
2317 | n->messages = mq->next; | 2335 | n->messages = mq->next; |
2318 | GNUNET_assert (0 == memcmp(mq->neighbor_id, &n->id, sizeof(struct GNUNET_PeerIdentity))); | 2336 | GNUNET_assert (0 == memcmp(mq->neighbor_id, &n->id, sizeof(struct GNUNET_PeerIdentity))); |
2337 | GNUNET_free (mq->neighbor_id); | ||
2319 | GNUNET_free (mq); | 2338 | GNUNET_free (mq); |
2320 | } | 2339 | } |
2321 | if (n->timeout_task != GNUNET_SCHEDULER_NO_TASK) | 2340 | if (n->timeout_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -2510,11 +2529,7 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2510 | GNUNET_assert ((service_context == NULL) || | 2529 | GNUNET_assert ((service_context == NULL) || |
2511 | (NULL != service_context->neighbor)); | 2530 | (NULL != service_context->neighbor)); |
2512 | 2531 | ||
2513 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING | | 2532 | return; |
2514 | GNUNET_ERROR_TYPE_BULK, | ||
2515 | _ | ||
2516 | ("NOT Dropping incoming message due to repeated bandwidth quota violations (total of %u).\n"), n->quota_violation_count); | ||
2517 | /* return; */ | ||
2518 | } | 2533 | } |
2519 | switch (ntohs (message->type)) | 2534 | switch (ntohs (message->type)) |
2520 | { | 2535 | { |