port,
ch,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
+ GNUNET_assert (NULL == ch->retry_control_task);
ch->retry_control_task
= GNUNET_SCHEDULER_add_delayed (TIMEOUT_CLOSED_PORT,
&timeout_closed_cb,
struct CadetChannel *ch = cls;
struct GNUNET_CADET_ChannelManageMessage msg;
+ ch->retry_control_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Sending CHANNEL_OPEN_ACK on %s\n",
GCCH_2s (ch));
- ch->retry_control_task = NULL;
msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK);
msg.header.size = htons (sizeof (msg));
msg.reserved = htonl (0);
struct CadetChannelClient *ccc;
/* Find which end is left... */
+ ch->retry_control_task = NULL;
ccc = (NULL != ch->owner) ? ch->owner : ch->dest;
GSC_handle_remote_channel_destroy (ccc->c,
ccc->ccn,
return;
}
ccc = (NULL != ch->owner) ? ch->owner : ch->dest;
- if (NULL != ccc->head_recv)
+ if ( (NULL != ccc) &&
+ (NULL != ccc->head_recv) )
{
LOG (GNUNET_ERROR_TYPE_WARNING,
"Lost end of transmission due to remote shutdown on %s\n",
/* FIXME: change API to notify client about truncated transmission! */
}
ch->destroy = GNUNET_YES;
- GSC_handle_remote_channel_destroy (ccc->c,
- ccc->ccn,
- ch);
+ if (NULL != ccc)
+ GSC_handle_remote_channel_destroy (ccc->c,
+ ccc->ccn,
+ ch);
channel_destroy (ch);
}
struct CadetChannelClient *receiver;
struct GNUNET_MQ_Envelope *env;
struct GNUNET_CADET_LocalData *ld;
- int to_owner;
+ int ack_to_owner;
env = GNUNET_MQ_msg_extra (ld,
buf_len,
ch->owner->ccn.channel_of_client) )
{
receiver = ch->dest;
- to_owner = GNUNET_NO;
+ ack_to_owner = GNUNET_YES;
}
else if ( (NULL != ch->dest) &&
(sender_ccn.channel_of_client ==
ch->dest->ccn.channel_of_client) )
{
receiver = ch->owner;
- to_owner = GNUNET_YES;
+ ack_to_owner = GNUNET_NO;
}
else
{
buf_len);
if (GNUNET_YES == receiver->client_ready)
{
+ ch->pending_messages--;
GSC_send_to_client (receiver->c,
env);
send_ack_to_client (ch,
- to_owner);
+ ack_to_owner);
}
else
{