diff options
author | Julius Bünger <buenger@mytum.de> | 2015-01-22 11:49:19 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-01-22 11:49:19 +0000 |
commit | 3254613881deecc099a6bf666cc8c1f1c849ecd2 (patch) | |
tree | 1f25a7c5541aa210b13d6c805b5fb396751ec706 /src | |
parent | 5883a1ad9483eba3871968d9b8c5dfd9c3db12c1 (diff) | |
download | gnunet-3254613881deecc099a6bf666cc8c1f1c849ecd2.tar.gz gnunet-3254613881deecc099a6bf666cc8c1f1c849ecd2.zip |
clean up ntfy_tmt_rdy handles on removal of peer
Diffstat (limited to 'src')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 9a7519728..929e47a42 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -168,6 +168,13 @@ struct PeerContext | |||
168 | //size_t num_outstanding_ops; | 168 | //size_t num_outstanding_ops; |
169 | 169 | ||
170 | /** | 170 | /** |
171 | * Handle to the callback given to cadet_ntfy_tmt_rdy() | ||
172 | * | ||
173 | * To be canceled on shutdown. | ||
174 | */ | ||
175 | struct GNUNET_CADET_TransmitHandle *is_live_task; | ||
176 | |||
177 | /** | ||
171 | * This is pobably followed by 'statistical' data (when we first saw | 178 | * This is pobably followed by 'statistical' data (when we first saw |
172 | * him, how did we get his ID, how many pushes (in a timeinterval), | 179 | * him, how did we get his ID, how many pushes (in a timeinterval), |
173 | * ...) | 180 | * ...) |
@@ -501,9 +508,9 @@ get_channel (struct GNUNET_CONTAINER_MultiPeerMap *peer_map, | |||
501 | { | 508 | { |
502 | tmp_peer = GNUNET_new (struct GNUNET_PeerIdentity); | 509 | tmp_peer = GNUNET_new (struct GNUNET_PeerIdentity); |
503 | *tmp_peer = *peer; | 510 | *tmp_peer = *peer; |
504 | (void) GNUNET_CADET_notify_transmit_ready (ctx->send_channel, GNUNET_NO, | 511 | ctx->is_live_task = GNUNET_CADET_notify_transmit_ready (ctx->send_channel, GNUNET_NO, |
505 | GNUNET_TIME_UNIT_FOREVER_REL, | 512 | GNUNET_TIME_UNIT_FOREVER_REL, |
506 | 0, peer_is_live, tmp_peer); | 513 | 0, peer_is_live, tmp_peer); |
507 | } | 514 | } |
508 | 515 | ||
509 | // do I have to explicitly put it in the peer_map? | 516 | // do I have to explicitly put it in the peer_map? |
@@ -1259,6 +1266,9 @@ peer_remove_cb (void *cls, const struct GNUNET_PeerIdentity *key, void *value) | |||
1259 | if ( NULL != peer_ctx->mq) | 1266 | if ( NULL != peer_ctx->mq) |
1260 | GNUNET_MQ_destroy (peer_ctx->mq); | 1267 | GNUNET_MQ_destroy (peer_ctx->mq); |
1261 | 1268 | ||
1269 | if ( NULL != peer_ctx->is_live_task) | ||
1270 | GNUNET_CADET_notify_transmit_ready_cancel (peer_ctx->is_live_task); | ||
1271 | |||
1262 | if ( NULL != peer_ctx->send_channel) | 1272 | if ( NULL != peer_ctx->send_channel) |
1263 | GNUNET_CADET_channel_destroy (peer_ctx->send_channel); | 1273 | GNUNET_CADET_channel_destroy (peer_ctx->send_channel); |
1264 | 1274 | ||