#endif
/* Clean up sessions */
GNUNET_CONTAINER_multihashmap_get_multiple (plugin->sessions, &target->hashPubKey, &disconnect_and_free_it, plugin);
-
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "FREEED SESSIONS from peer `%s'\n", GNUNET_i2s (target));
}
static struct Session *
* a fresh connection to another peer.
*
* @param cls closure
- * @param session which session must be used
+ * @param s which session must be used
* @param msgbuf the message to transmit
* @param msgbuf_size number of bytes in 'msgbuf'
* @param priority how important is the message (most plugins will
return mlen;
}
-static ssize_t udp_plugin_send_wrapper (void *cls,
- const struct
- GNUNET_PeerIdentity *
- target,
- const char *msgbuf,
- size_t msgbuf_size,
- uint32_t priority,
- struct
- GNUNET_TIME_Relative
- timeout,
- struct Session * session,
- const void *addr,
- size_t addrlen,
- int force_address,
- GNUNET_TRANSPORT_TransmitContinuation
- cont, void *cont_cls)
-{
- int ret;
- struct Session * s = NULL;
- struct GNUNET_HELLO_Address * ha = NULL;
-
- ha = GNUNET_HELLO_address_allocate(target, "", addr,addrlen);
- GNUNET_assert (ha != NULL);
- s = udp_plugin_get_session(cls, ha);
- GNUNET_assert (s != NULL);
- GNUNET_free (ha);
- ret = udp_plugin_send (cls, s, msgbuf, msgbuf_size, priority, timeout, cont, cont_cls);
-
- return ret;
-}
-
/**
* Our external IP address/port mapping has changed.
plugin->sockv6 = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_DGRAM, 0);
if (NULL == plugin->sockv6)
{
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "socket");
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Disabling IPv6 since it is not supported on this system!");
+ plugin->enable_ipv6 = GNUNET_NO;
}
else
{
#if HAVE_SOCKADDR_IN_SIN_LEN
- serverAddrv6.sin6_len = sizeof (serverAddrv6);
+ serverAddrv6->sin6_len = sizeof (serverAddrv6);
#endif
serverAddrv6->sin6_family = AF_INET6;
serverAddrv6->sin6_addr = in6addr_any;
else
{
#if HAVE_SOCKADDR_IN_SIN_LEN
- serverAddrv4.sin_len = sizeof (serverAddrv4);
+ serverAddrv4->sin_len = sizeof (serverAddrv4);
#endif
serverAddrv4->sin_family = AF_INET;
serverAddrv4->sin_addr.s_addr = INADDR_ANY;
api->address_to_string = &udp_address_to_string;
api->check_address = &udp_plugin_check_address;
api->get_session = &udp_plugin_get_session;
- api->send = &udp_plugin_send_wrapper;
- api->send_with_session = &udp_plugin_send;
+ api->send = &udp_plugin_send;
LOG (GNUNET_ERROR_TYPE_DEBUG, "Setting up sockets\n");
res = setup_sockets (plugin, &serverAddrv6, &serverAddrv4);