uint32_t options)
{
struct GNUNET_MQ_Envelope *env;
- struct GNUNET_CADET_LocalChannelCreateMessage *msg;
+ struct GNUNET_CADET_LocalChannelCreateMessage *cm;
struct GNUNET_CADET_ClientChannelNumber ccn;
ccn = client_get_next_ccn (c);
GNUNET_h2s (port),
ntohl (options));
/* notify local client about incoming connection! */
- env = GNUNET_MQ_msg (msg,
+ env = GNUNET_MQ_msg (cm,
GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
- msg->ccn = ccn;
- msg->port = *port;
- msg->opt = htonl (options);
- msg->peer = *GCP_get_id (dest);
+ cm->ccn = ccn;
+ cm->port = *port;
+ cm->opt = htonl (options);
+ cm->peer = *GCP_get_id (dest);
GSC_send_to_client (c,
env);
return ccn;
GCCH_bind (struct CadetChannel *ch,
struct CadetClient *c)
{
- struct GNUNET_MQ_Envelope *env;
- struct GNUNET_CADET_LocalChannelCreateMessage *tcm;
uint32_t options;
LOG (GNUNET_ERROR_TYPE_DEBUG,
ch);
}
/* give client it's initial supply of ACKs */
- env = GNUNET_MQ_msg (tcm,
- GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
- tcm->ccn = ch->ccn_dest;
- if (GNUNET_YES == ch->is_loopback)
- tcm->peer = my_full_id;
- else
- tcm->peer = *GCP_get_id (GCT_get_destination (ch->t));
- tcm->port = ch->port;
- tcm->opt = htonl (options);
- GSC_send_to_client (ch->dest,
- env);
for (unsigned int i=0;i<ch->max_pending_messages;i++)
send_ack_to_client (ch,
ch->dest);
ok++;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
if ((long) cls == peers_requested - 1)
+ {
+ if (NULL != incoming_ch)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Duplicate incoming channel for client %lu\n",
+ (long) cls);
+ GNUNET_break(0);
+ }
incoming_ch = channel;
+ }
else
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,