/**
* Useful for zone update for DHT put
*/
-static int num_public_records = 0;
+static int num_public_records;
/**
* update interval in seconds
*/
-static unsigned long long int max_record_put_interval;
+static unsigned long long max_record_put_interval;
-static unsigned long long int dht_max_update_interval;
+static unsigned long long dht_max_update_interval;
/* dht update interval FIXME define? */
static struct GNUNET_TIME_Relative record_put_interval;
static void
update_zone_dht_start(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling DHT zone update!\n");
-
- unsigned long long int interval = 0;
+ unsigned long long interval = 0;
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling DHT zone update!\n");
if (0 == num_public_records)
{
/**
{
struct Plugin *plugin = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Accepting new incoming TCP connection\n");
if (0 == plugin->max_connections)
return GNUNET_NO;
plugin->max_connections--;
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
"Creating new session for peer `%4s'\n",
GNUNET_i2s (target));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Creating new TCP session for peer `%s'\n",
+ GNUNET_i2s (target));
ret = GNUNET_malloc (sizeof (struct Session));
ret->last_activity = GNUNET_TIME_absolute_get ();
struct Session * result;
};
-int session_lookup_it (void *cls,
- const GNUNET_HashCode * key,
- void *value)
+static int
+session_lookup_it (void *cls,
+ const GNUNET_HashCode * key,
+ void *value)
{
struct SessionItCtx * si_ctx = cls;
struct Session * session = value;
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
"NAT WAIT connection to `%4s' at `%s' could not be established, removing session\n",
GNUNET_i2s (&session->target), tcp_address_to_string(NULL, session->addr, session->addrlen));
-
disconnect_session (session);
-
}
+
/**
* Create a new session to transmit data to the target
* This session will used to send data to this peer and the plugin will
{
struct Plugin * plugin = cls;
struct Session * session = NULL;
-
int af;
const void *sb;
size_t sbs;
const struct IPv6TcpAddress *t6;
struct GNUNET_ATS_Information ats;
unsigned int is_natd = GNUNET_NO;
- size_t addrlen = 0;
+ size_t addrlen;
GNUNET_assert (plugin != NULL);
GNUNET_assert (address != NULL);
-
addrlen = address->address_length;
-
- GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
- "Trying to get session for `%s' address length %i\n",
+ GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
+ "Trying to get session for `%s' address of peer `%s'\n",
tcp_address_to_string(NULL, address->address, address->address_length),
- addrlen);
+ GNUNET_i2s (&address->peer));
/* look for existing session */
- if (GNUNET_CONTAINER_multihashmap_contains(plugin->sessionmap, &address->peer.hashPubKey))
+ if (GNUNET_YES ==
+ GNUNET_CONTAINER_multihashmap_contains(plugin->sessionmap, &address->peer.hashPubKey))
{
struct SessionItCtx si_ctx;
session);
return session;
}
+ GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
+ "Existing sessions did not match address `%s' or peer `%s'\n",
+ tcp_address_to_string(NULL, address->address, address->address_length),
+ GNUNET_i2s (&address->peer));
+
}
if (addrlen == sizeof (struct IPv6TcpAddress))
&address->peer.hashPubKey)))
{
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
- _("Found valid IPv4 NAT address (creating session)!\n"));
+ "Found valid IPv4 NAT address (creating session)!\n") ;
session = create_session (plugin, &address->peer, NULL, GNUNET_YES);
session->addrlen = 0;
session->addr = NULL;
}
plugin->max_connections--;
- GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
+ GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
"Asked to transmit to `%4s', creating fresh session using address `%s'.\n",
GNUNET_i2s (&address->peer), GNUNET_a2s (sb, sbs));
return;
}
- GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
+ GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
"Received %s message from `%4s'\n", "WELCOME",
GNUNET_i2s (&wm->clientIdentity));
GNUNET_STATISTICS_update (plugin->env->stats,