diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-22 20:13:39 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-22 20:13:39 +0100 |
commit | 88c8852e82b8c818571946ba4fec0e14c7239266 (patch) | |
tree | 48645f237a072b3563b926e2d236628e5912172a /src/cadet/gnunet-service-cadet-new_channel.c | |
parent | 792b1a6301f0eab898120729ad35b9da47aeab33 (diff) | |
download | gnunet-88c8852e82b8c818571946ba4fec0e14c7239266.tar.gz gnunet-88c8852e82b8c818571946ba4fec0e14c7239266.zip |
fixing misc cleanup issues
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_channel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_channel.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index f3603d898..425422cb6 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -170,14 +170,6 @@ struct CadetChannel | |||
170 | struct CadetTunnel *t; | 170 | struct CadetTunnel *t; |
171 | 171 | ||
172 | /** | 172 | /** |
173 | * Last entry in the tunnel's queue relating to control messages | ||
174 | * (#GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN or | ||
175 | * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK). Used to cancel | ||
176 | * transmission in case we receive updated information. | ||
177 | */ | ||
178 | struct CadetTunnelQueueEntry *last_control_qe; | ||
179 | |||
180 | /** | ||
181 | * Client owner of the tunnel, if any. | 173 | * Client owner of the tunnel, if any. |
182 | * (Used if this channel represends the initiating end of the tunnel.) | 174 | * (Used if this channel represends the initiating end of the tunnel.) |
183 | */ | 175 | */ |
@@ -190,6 +182,14 @@ struct CadetChannel | |||
190 | struct CadetClient *dest; | 182 | struct CadetClient *dest; |
191 | 183 | ||
192 | /** | 184 | /** |
185 | * Last entry in the tunnel's queue relating to control messages | ||
186 | * (#GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN or | ||
187 | * #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK). Used to cancel | ||
188 | * transmission in case we receive updated information. | ||
189 | */ | ||
190 | struct CadetTunnelQueueEntry *last_control_qe; | ||
191 | |||
192 | /** | ||
193 | * Head of DLL of messages sent and not yet ACK'd. | 193 | * Head of DLL of messages sent and not yet ACK'd. |
194 | */ | 194 | */ |
195 | struct CadetReliableMessage *head_sent; | 195 | struct CadetReliableMessage *head_sent; |
@@ -417,6 +417,7 @@ channel_open_sent_cb (void *cls) | |||
417 | { | 417 | { |
418 | struct CadetChannel *ch = cls; | 418 | struct CadetChannel *ch = cls; |
419 | 419 | ||
420 | GNUNET_assert (NULL != ch->last_control_qe); | ||
420 | ch->last_control_qe = NULL; | 421 | ch->last_control_qe = NULL; |
421 | ch->retry_time = GNUNET_TIME_STD_BACKOFF (ch->retry_time); | 422 | ch->retry_time = GNUNET_TIME_STD_BACKOFF (ch->retry_time); |
422 | ch->retry_task = GNUNET_SCHEDULER_add_delayed (ch->retry_time, | 423 | ch->retry_task = GNUNET_SCHEDULER_add_delayed (ch->retry_time, |
@@ -620,6 +621,7 @@ send_ack_cb (void *cls) | |||
620 | { | 621 | { |
621 | struct CadetChannel *ch = cls; | 622 | struct CadetChannel *ch = cls; |
622 | 623 | ||
624 | GNUNET_assert (NULL != ch->last_control_qe); | ||
623 | ch->last_control_qe = NULL; | 625 | ch->last_control_qe = NULL; |
624 | } | 626 | } |
625 | 627 | ||
@@ -1025,18 +1027,13 @@ GCCH_handle_channel_plaintext_data_ack (struct CadetChannel *ch, | |||
1025 | void | 1027 | void |
1026 | GCCH_handle_remote_destroy (struct CadetChannel *ch) | 1028 | GCCH_handle_remote_destroy (struct CadetChannel *ch) |
1027 | { | 1029 | { |
1028 | struct GNUNET_MQ_Envelope *env; | ||
1029 | struct GNUNET_CADET_LocalChannelDestroyMessage *tdm; | ||
1030 | |||
1031 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1030 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1032 | "Received remote channel DESTROY for %s\n", | 1031 | "Received remote channel DESTROY for %s\n", |
1033 | GCCH_2s (ch)); | 1032 | GCCH_2s (ch)); |
1034 | ch->destroy = GNUNET_YES; | 1033 | ch->destroy = GNUNET_YES; |
1035 | env = GNUNET_MQ_msg (tdm, | 1034 | GSC_handle_remote_channel_destroy ((NULL != ch->owner) ? ch->owner : ch->dest, |
1036 | GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY); | 1035 | ch->ccn, |
1037 | tdm->ccn = ch->ccn; | 1036 | ch); |
1038 | GSC_send_to_client ((NULL != ch->owner) ? ch->owner : ch->dest, | ||
1039 | env); | ||
1040 | channel_destroy (ch); | 1037 | channel_destroy (ch); |
1041 | } | 1038 | } |
1042 | 1039 | ||