#define SETUP_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
-#define TEST_NEW_CODE GNUNET_NO
+#define TEST_NEW_CODE GNUNET_YES
/**
* Entry in neighbours.
static ssize_t
send_with_session (struct NeighbourMapEntry *n,
- struct Session *session,
const char *msgbuf, size_t msgbuf_size,
uint32_t priority,
struct GNUNET_TIME_Relative timeout,
struct GNUNET_TRANSPORT_PluginFunctions *papi;
size_t ret = GNUNET_SYSERR;
+ GNUNET_assert (n != NULL);
+ GNUNET_assert (n->session != NULL);
+
papi = GST_plugins_find (n->address->transport_name);
if (papi == NULL)
{
}
ret = papi->send_with_session (papi->cls,
- session,
+ n->session,
msgbuf, msgbuf_size,
0,
timeout,
}
#if TEST_NEW_CODE
- ret = send_with_session(n, n->session,
+ ret = send_with_session(n,
mq->message_buf, mq->message_buf_size,
0, timeout,
&transmit_send_continuation, mq);
&disconnect_msg.signature));
#if TEST_NEW_CODE
- ret = send_with_session (n,n->session,
+ ret = send_with_session (n,
(const char *) &disconnect_msg, sizeof (disconnect_msg),
UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
&send_disconnect_cont, NULL);
m.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE);
#if TEST_NEW_CODE
- ret = send_with_session (n,n->session,
+ ret = send_with_session (n,
(const void *) &m, sizeof (m),
UINT32_MAX /* priority */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
* connection is not up (yet)
*/
int
-GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer,
+GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_HELLO_Address
*address,
struct Session *session,
n->session = session;
/* dummy */
- if (NULL != NULL) send_with_session(NULL, NULL, NULL, 0, 0, GNUNET_TIME_relative_get_zero(), NULL, NULL);
+ if (NULL != NULL) send_with_session( NULL, NULL, 0, 0, GNUNET_TIME_relative_get_zero(), NULL, NULL);
#endif
switch (n->state)
cc->address = GNUNET_HELLO_address_copy (address);
#if TEST_NEW_CODE
- ret = send_with_session (n,n->session,
+ ret = send_with_session (n,
(const char *) &connect_msg, msg_len,
UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
&send_connect_continuation, cc);
cc->session = session;
cc->address = GNUNET_HELLO_address_copy (address);
#if TEST_NEW_CODE
- ret = send_with_session(n, n->session,
+ ret = send_with_session(n,
(const void *) &connect_msg, msg_len,
UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
&send_connect_ack_continuation,
cc->address = GNUNET_HELLO_address_copy (address);
#if TEST_NEW_CODE
- ret = send_with_session(n, n->session,
+ ret = send_with_session(n,
(const void *) &connect_msg, msg_len,
UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
&send_switch_address_continuation, cc);
m.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE_RESPONSE);
#if TEST_NEW_CODE
- send_with_session(n, n->session,
+ send_with_session(n,
(const void *) &m, sizeof (m),
UINT32_MAX,
GNUNET_TIME_UNIT_FOREVER_REL,
}
GNUNET_ATS_address_update (GST_ats, address, session, ats, ats_count);
GNUNET_assert (NULL != n->address);
+//LOOKAT
if ((n->address_state == FRESH) && (0 == GNUNET_HELLO_address_cmp(address, n->address)))
{
- if (n->session == NULL)
- n->session = session;
GST_validation_set_address_use (n->address, n->session, GNUNET_YES);
GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_YES);
n->address_state = USED;
-
}
GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in);
msg.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_ACK);
#if TEST_NEW_CODE
- ret = send_with_session(n, n->session,
+ ret = send_with_session(n,
(const char *) &msg, msg_len,
UINT32_MAX, GNUNET_TIME_UNIT_FOREVER_REL,
NULL, NULL);
session, address->transport_name, GNUNET_i2s (peer));
GNUNET_ATS_address_update (GST_ats, address, session, ats, ats_count);
GNUNET_assert (n->address != NULL);
+// LOOKAT
if ((n->address_state == FRESH) && (0 == GNUNET_HELLO_address_cmp(address, n->address)))
{
- if (n->session == NULL)
- n->session = session;
GST_validation_set_address_use (n->address, n->session, GNUNET_YES);
GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_YES);
n->address_state = USED;
}
+
neighbours_connected++;
GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1,
GNUNET_NO);