* #GNUNET_SYSERR to close it (signal serious error)
*/
static int
-receive_tcp_remote (void *cls GNUNET_UNUSED, struct GNUNET_CADET_Channel *channel,
+receive_tcp_remote (void *cls GNUNET_UNUSED,
+ struct GNUNET_CADET_Channel *channel,
void **channel_ctx GNUNET_UNUSED,
const struct GNUNET_MessageHeader *message)
{
*/
int af;
+ /**
+ * Is this channel new (#GNUNET_NO), or did we exchange messages with the
+ * other side already (#GNUNET_YES)?
+ */
+ int is_established;
+
/**
* Length of the doubly linked 'tmq_head/tmq_tail' list.
*/
struct ChannelMessageQueueEntry *tnq;
size_t alen;
size_t mlen;
- int is_new;
const struct GNUNET_TUN_UdpHeader *udp;
const struct GNUNET_TUN_TcpHeader *tcp;
const struct GNUNET_TUN_IcmpHeader *icmp;
{
/* need to either use the existing channel from the destination (if still
available) or create a fresh one */
- is_new = GNUNET_YES;
if (NULL == dt->ts)
ts = create_channel_to_destination (dt, af);
else
}
else
{
- is_new = GNUNET_NO;
GNUNET_CONTAINER_heap_update_cost (channel_heap,
ts->heap_node,
GNUNET_TIME_absolute_get ().abs_value_us);
}
break;
case IPPROTO_TCP:
- if (is_new)
+ if (GNUNET_NO == ts->is_established)
{
if (destination->is_service)
{
GNUNET_assert (0);
break;
}
+ ts->is_established = GNUNET_YES;
send_to_channel (tnq, ts);
}
cadet_handle =
GNUNET_CADET_connect (cfg_, NULL,
- NULL,
- &channel_cleaner,
- cadet_handlers,
- NULL);
+ NULL,
+ &channel_cleaner,
+ cadet_handlers,
+ NULL);
helper_handle = GNUNET_HELPER_start (GNUNET_NO,
"gnunet-helper-vpn", vpn_argv,
&message_token, NULL, NULL);
nc = GNUNET_SERVER_notification_context_create (server, 1);
GNUNET_SERVER_add_handlers (server, service_handlers);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &cleanup,
+ NULL);
}