uint32_t bck_ack;
/**
- * Circular buffer pointing to MeshPeerQueue elements.
- * Size determined by the tunnel queue size.
+ * Circular buffer pointing to MeshPeerQueue elements for all
+ * payload traffic going to this child.
+ * Size determined by the tunnel queue size (@c t->fwd_queue_max).
*/
struct MeshPeerQueue **send_buffer;
/**
- * Queue and pass message to core when possible.
+ * @brief Queue and pass message to core when possible.
+ *
+ * If type is payload (UNICAST, TO_ORIGIN, MULTICAST) checks for queue status
+ * and accounts for it. In case the queue is full, the message is dropped and
+ * a break issued.
+ *
+ * Otherwise, message is treated as internal and allowed to go regardless of
+ * queue status.
*
- * @param cls Closure (type dependant).
+ * @param cls Closure (@c type dependant). It will be used by queue_send to
+ * build the message to be sent if not already prebuilt.
* @param type Type of the message, 0 for a raw message.
* @param size Size of the message.
* @param dst Neighbor to send message to.
/* Find the longest match for the current string position,
* among tokens in the given block */
+ ctx->longest_match = 0;
result = GNUNET_MESH_regex_block_iterate (block, size,
®ex_edge_iterator, ctx);
GNUNET_break (GNUNET_OK == result || SIZE_MAX == size);
+ /* Did anything match? */
+ if (0 == ctx->longest_match)
+ return;
+
new_ctx = GNUNET_malloc (sizeof (struct MeshRegexSearchContext));
new_ctx->info = info;
new_ctx->position = ctx->position + ctx->longest_match;
* @param t Tunnel on which this message is transmitted.
*/
static void
-send_message (const struct GNUNET_MessageHeader *message,
- const struct GNUNET_PeerIdentity *peer,
- struct MeshTunnel *t)
+send_prebuilt_message (const struct GNUNET_MessageHeader *message,
+ const struct GNUNET_PeerIdentity *peer,
+ struct MeshTunnel *t)
{
struct MeshTransmissionDescriptor *info;
struct MeshPeerInfo *neighbor;
}
info->peer = neighbor;
if (GNUNET_MESSAGE_TYPE_MESH_PATH_ACK == type)
- {
- /*
- * TODO: in this case we only need the service to retransmit
- * the message down the path. If we pass the real type to queue_add,
- * queue_send will try to build the message from scratch. This can
- * probably be done by some other way instead of deleteing the type
- * info.
- */
type = 0;
- }
queue_add (info,
type,
size,
{
GNUNET_PEER_resolve (p->peers[i], &pi[i]);
}
- send_message (&msg->header, tree_get_first_hop (t->tree, destination), t);
+ send_prebuilt_message (&msg->header, tree_get_first_hop (t->tree, destination), t);
}
path_destroy (p);
}
+/**
+ * Sends a PATH ACK message in reponse to a received PATH_CREATE directed to us.
+ *
+ * @param t Tunnel which to confirm.
+ */
+static void
+send_path_ack (struct MeshTunnel *t)
+{
+ struct MeshTransmissionDescriptor *info;
+ struct GNUNET_PeerIdentity id;
+ GNUNET_PEER_Id peer;
+
+ peer = tree_get_predecessor (t->tree);
+ GNUNET_PEER_resolve (peer, &id);
+ info = GNUNET_malloc (sizeof (struct MeshTransmissionDescriptor));
+ info->origin = &t->id;
+ info->peer = GNUNET_CONTAINER_multihashmap_get (peers, &id.hashPubKey);
+ GNUNET_assert (NULL != info->peer);
+
+ queue_add (info,
+ GNUNET_MESSAGE_TYPE_MESH_PATH_ACK,
+ sizeof (struct GNUNET_MESH_PathACK),
+ info->peer,
+ t);
+}
+
+
/**
* Try to establish a new connection to this peer.
* Use the best path for the given tunnel.
/**
- * Iterator to free MeshTunnelChildInfo of tunnel children.
+ * @brief Iterator to destroy MeshTunnelChildInfo of tunnel children.
+ *
+ * Destroys queue elements of all waiting transmissions and frees all memory
+ * used by the struct and its elements.
*
* @param cls Closure (tunnel info).
* @param key Hash of GNUNET_PEER_Id (unused).
{
i = (cinfo->send_buffer_start + c) % t->fwd_queue_max;
if (NULL != cinfo->send_buffer[i])
- queue_destroy(cinfo->send_buffer[i], GNUNET_YES);
+ queue_destroy (cinfo->send_buffer[i], GNUNET_YES);
else
GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%u %u\n", c, cinfo->send_buffer_n);
msg.peer1 = my_full_id;
GNUNET_PEER_resolve (pid, &msg.peer2);
GNUNET_PEER_resolve (tree_get_predecessor (t->tree), &neighbor);
- send_message (&msg.header, &neighbor, t);
+ send_prebuilt_message (&msg.header, &neighbor, t);
}
}
return pid;
struct MeshData *mdata = cls;
struct MeshTransmissionDescriptor *info;
struct GNUNET_PeerIdentity neighbor;
+ struct GNUNET_MessageHeader *msg;
info = GNUNET_malloc (sizeof (struct MeshTransmissionDescriptor));
GNUNET_i2s (&neighbor));
info->peer = peer_info_get (&neighbor);
GNUNET_assert (NULL != info->peer);
+ msg = (struct GNUNET_MessageHeader *) mdata->data;
queue_add(info,
- GNUNET_MESSAGE_TYPE_MESH_MULTICAST,
+ ntohs (msg->type),
info->mesh_data->data_len,
info->peer,
mdata->t);
*
* @param t Tunnel in which to send the data.
* @param msg Message to be sent.
- * @param internal DEPRECATED Has the service generated this message?
- *
- * FIXME remove internal if no use comes up
*/
static void
tunnel_send_multicast (struct MeshTunnel *t,
- const struct GNUNET_MessageHeader *msg,
- int internal)
+ const struct GNUNET_MessageHeader *msg)
{
struct MeshData *mdata;
ctx.t = t;
ctx.max_child_ack = 0;
ctx.nchildren = 0;
+ ctx.init = GNUNET_NO;
tree_iterate_children (t->tree, tunnel_get_child_fwd_ack, &ctx);
if (0 == ctx.nchildren)
count = t->fwd_pid - t->skip;
buffer_free = t->fwd_queue_max - t->fwd_queue_n;
- ack = count + buffer_free; // Might overflow 32 bits, it's ok!
+ ack = count;
child_ack = tunnel_get_children_fwd_ack (t);
client_ack = tunnel_get_clients_fwd_ack (t);
if (-1LL == child_ack)
}
if (-1LL == client_ack)
{
- client_ack = ack;
+ client_ack = ack + buffer_free; // Might overflow 32 bits, it's ok!
}
if (GNUNET_YES == t->speed_min)
{
- ack = GMC_min_pid ((uint32_t) child_ack, ack);
+ ack = GMC_min_pid ((uint32_t) child_ack, ack) + buffer_free; // Might overflow 32 bits, it's ok!;
ack = GMC_min_pid ((uint32_t) client_ack, ack);
}
else
{
- ack = GMC_max_pid ((uint32_t) child_ack, ack);
+ ack = GMC_max_pid ((uint32_t) child_ack, ack) + buffer_free; // Might overflow 32 bits, it's ok!;
ack = GMC_max_pid ((uint32_t) client_ack, ack);
}
if (GNUNET_YES == t->nobuffer && GMC_is_pid_bigger(ack, t->fwd_pid))
msg.pid = htonl (ack);
msg.tid = htonl (t->id.tid);
- send_message (&msg.header, peer, t);
+ send_prebuilt_message (&msg.header, peer, t);
}
}
/* Check if we need no retransmit the ACK */
- if (t->fwd_queue_max > t->fwd_queue_n * 2 &&
+ if (t->fwd_queue_max > t->fwd_queue_n * 4 &&
GMC_is_pid_bigger(t->last_fwd_ack, t->fwd_pid))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Not sending ACK, buffer free\n");
msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY);
GNUNET_PEER_resolve (t->id.oid, &msg.oid);
msg.tid = htonl (t->id.tid);
- tunnel_send_multicast (t, &msg.header, GNUNET_NO);
+ tunnel_send_multicast (t, &msg.header);
}
GNUNET_CRYPTO_hash (&t->id, sizeof (struct MESH_TunnelID), &hash);
if (GNUNET_YES != GNUNET_CONTAINER_multihashmap_remove (tunnels, &hash, t))
{
+ GNUNET_break (0);
r = GNUNET_SYSERR;
}
- GNUNET_CRYPTO_hash (&t->local_tid, sizeof (MESH_TunnelNumber), &hash);
- if (NULL != c &&
- GNUNET_YES !=
- GNUNET_CONTAINER_multihashmap_remove (c->own_tunnels, &hash, t))
+ if (NULL != c)
{
- r = GNUNET_SYSERR;
+ GNUNET_CRYPTO_hash (&t->local_tid, sizeof (MESH_TunnelNumber), &hash);
+ if (GNUNET_YES !=
+ GNUNET_CONTAINER_multihashmap_remove (c->own_tunnels, &hash, t))
+ {
+ GNUNET_break (0);
+ r = GNUNET_SYSERR;
+ }
}
+
GNUNET_CRYPTO_hash (&t->local_tid_dest, sizeof (MESH_TunnelNumber), &hash);
for (i = 0; i < t->nclients; i++)
{
if (GNUNET_YES !=
GNUNET_CONTAINER_multihashmap_remove (c->incoming_tunnels, &hash, t))
{
+ GNUNET_break (0);
r = GNUNET_SYSERR;
}
}
if (GNUNET_YES !=
GNUNET_CONTAINER_multihashmap_remove (c->ignore_tunnels, &hash, t))
{
+ GNUNET_break (0);
r = GNUNET_SYSERR;
}
}
+
if (t->nclients > 0)
{
if (GNUNET_YES !=
GNUNET_CONTAINER_multihashmap_remove (incoming_tunnels, &hash, t))
{
+ GNUNET_break (0);
r = GNUNET_SYSERR;
}
GNUNET_free (t->clients);
}
+
if (NULL != t->peers)
{
GNUNET_CONTAINER_multihashmap_iterate (t->peers, &peer_info_delete_tunnel,
* @param key the hash of the local tunnel id (used to access the hashmap)
* @param value the value stored at the key (tunnel to destroy)
*
- * @return GNUNET_OK on success
+ * @return GNUNET_OK, keep iterating.
*/
static int
tunnel_destroy_iterator (void *cls, const struct GNUNET_HashCode * key, void *value)
{
struct MeshTunnel *t = value;
struct MeshClient *c = cls;
- int r;
send_client_tunnel_disconnect(t, c);
if (c != t->owner)
return GNUNET_OK;
}
tunnel_send_destroy(t);
- r = tunnel_destroy (t);
- return r;
+ t->owner = NULL;
+ t->destroy = GNUNET_YES;
+
+ return GNUNET_OK;
}
tunnel_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct MeshTunnel *t = cls;
+ struct GNUNET_PeerIdentity id;
+ t->timeout_task = GNUNET_SCHEDULER_NO_TASK;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
- t->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_PEER_resolve(t->id.oid, &id);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Tunnel %s [%X] timed out. Destroying.\n",
+ GNUNET_i2s(&id), t->id.tid);
tunnel_destroy (t);
}
if (GNUNET_YES == t->nobuffer)
opt |= MESH_TUNNEL_OPT_NOBUFFER;
msg->opt = htonl(opt);
+ msg->reserved = 0;
peer_ptr = (struct GNUNET_PeerIdentity *) &msg[1];
for (i = 0; i < p->length; i++)
{
struct MeshTransmissionDescriptor *dd;
struct MeshPathInfo *path_info;
+ struct MeshTunnelChildInfo *cinfo;
+ struct GNUNET_PeerIdentity id;
+ unsigned int i;
+ unsigned int max;
if (GNUNET_YES == clear_cls)
{
switch (queue->type)
{
- case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
- case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
- case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " type payload\n");
+ case GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY:
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, " cancelling TUNNEL_DESTROY\n");
+ /* fall through */
+ case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
+ case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
+ case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ " type prebuilt (payload, tunnel destroy)\n");
dd = queue->cls;
data_descriptor_decrement_rc (dd->mesh_data);
break;
- case GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE:
+ case GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " type create path\n");
path_info = queue->cls;
path_destroy (path_info->path);
break;
- default:
+ default:
GNUNET_break (0);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
" type %s unknown!\n",
GNUNET_CONTAINER_DLL_remove (queue->peer->queue_head,
queue->peer->queue_tail,
queue);
+
+ /* Delete from child_fc in the appropiate tunnel */
+ max = queue->tunnel->fwd_queue_max;
+ GNUNET_PEER_resolve (queue->peer->id, &id);
+ cinfo = tunnel_get_neighbor_fc (queue->tunnel, &id);
+ for (i = 0; i < cinfo->send_buffer_n; i++)
+ {
+ unsigned int i2;
+ i2 = (cinfo->send_buffer_start + i) % max;
+ if (cinfo->send_buffer[i2] == queue)
+ {
+ /* Found corresponding entry in the send_buffer. Move all others back. */
+ unsigned int j;
+ unsigned int j2;
+ unsigned int j3;
+
+ for (j = i, j2 = 0, j3 = 0; j < cinfo->send_buffer_n - 1; j++)
+ {
+ j2 = (cinfo->send_buffer_start + j) % max;
+ j3 = (cinfo->send_buffer_start + j + 1) % max;
+ cinfo->send_buffer[j2] = cinfo->send_buffer[j3];
+ }
+
+ cinfo->send_buffer[j3] = NULL;
+
+ cinfo->send_buffer_n--;
+ }
+ }
+ //queue->
+
GNUNET_free (queue);
}
size_t data_size;
peer->core_transmit = NULL;
-
+
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* Queue send\n");
- queue = queue_get_next(peer);
+ queue = queue_get_next (peer);
- /* Queue has no internal mesh traffic not sendable payload */
+ /* Queue has no internal mesh traffic nor sendable payload */
if (NULL == queue)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* not ready, return\n");
if (NULL == peer->queue_head)
- GNUNET_break(0); // Should've been canceled
+ GNUNET_break (0); // Should've been canceled
return 0;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* not empty\n");
/* Check if buffer size is enough for the message */
if (queue->size > size)
{
-
-
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"********* not enough room, reissue\n");
peer->core_transmit =
- GNUNET_CORE_notify_transmit_ready(core_handle,
- 0,
- 0,
- GNUNET_TIME_UNIT_FOREVER_REL,
- &dst_id,
- queue->size,
- &queue_send,
- peer);
+ GNUNET_CORE_notify_transmit_ready (core_handle,
+ 0,
+ 0,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &dst_id,
+ queue->size,
+ &queue_send,
+ peer);
return 0;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* size ok\n");
tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST);
break;
case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
- tunnel_send_bck_ack(t, GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN);
+ tunnel_send_bck_ack (t, GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN);
break;
default:
break;
break;
case GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path create\n");
- data_size = send_core_path_create(queue->cls, size, buf);
+ data_size = send_core_path_create (queue->cls, size, buf);
break;
case GNUNET_MESSAGE_TYPE_MESH_PATH_ACK:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path ack\n");
- data_size = send_core_path_ack(queue->cls, size, buf);
+ data_size = send_core_path_ack (queue->cls, size, buf);
+ break;
+ case GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE:
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* path keepalive\n");
+ data_size = send_core_data_multicast (queue->cls, size, buf);
break;
default:
GNUNET_break (0);
case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
- cinfo = tunnel_get_neighbor_fc(t, &dst_id);
+ cinfo = tunnel_get_neighbor_fc (t, &dst_id);
if (cinfo->send_buffer[cinfo->send_buffer_start] != queue)
{
- GNUNET_break(0);
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ GNUNET_break (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"at pos %u (%p) != %p\n",
cinfo->send_buffer_start,
cinfo->send_buffer[cinfo->send_buffer_start],
queue);
}
- GNUNET_break(cinfo->send_buffer_n > 0);
- cinfo->send_buffer[cinfo->send_buffer_start] = NULL;
- cinfo->send_buffer_n--;
- cinfo->send_buffer_start++;
- cinfo->send_buffer_start %= t->fwd_queue_max;
+ if (cinfo->send_buffer_n > 0)
+ {
+ cinfo->send_buffer[cinfo->send_buffer_start] = NULL;
+ cinfo->send_buffer_n--;
+ cinfo->send_buffer_start++;
+ cinfo->send_buffer_start %= t->fwd_queue_max;
+ }
+ else
+ {
+ GNUNET_break (0);
+ }
break;
default:
break;
/**
- * Queue and pass message to core when possible.
+ * @brief Queue and pass message to core when possible.
+ *
+ * If type is payload (UNICAST, TO_ORIGIN, MULTICAST) checks for queue status
+ * and accounts for it. In case the queue is full, the message is dropped and
+ * a break issued.
+ *
+ * Otherwise, message is treated as internal and allowed to go regardless of
+ * queue status.
*
- * @param cls Closure (type dependant).
+ * @param cls Closure (@c type dependant). It will be used by queue_send to
+ * build the message to be sent if not already prebuilt.
* @param type Type of the message, 0 for a raw message.
* @param size Size of the message.
* @param dst Neighbor to send message to.
if (NULL == dst->core_transmit)
{
dst->core_transmit =
- GNUNET_CORE_notify_transmit_ready(core_handle,
- 0,
- 0,
- GNUNET_TIME_UNIT_FOREVER_REL,
- &id,
- size,
- &queue_send,
- dst);
+ GNUNET_CORE_notify_transmit_ready (core_handle,
+ 0,
+ 0,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ &id,
+ size,
+ &queue_send,
+ dst);
}
if (NULL == n) // Is this internal mesh traffic?
return;
if (NULL != cinfo->send_buffer[i])
{
GNUNET_break (cinfo->send_buffer_n == t->fwd_queue_max); // aka i == start
- queue_destroy(cinfo->send_buffer[cinfo->send_buffer_start], GNUNET_YES);
+ queue_destroy (cinfo->send_buffer[cinfo->send_buffer_start], GNUNET_YES);
cinfo->send_buffer_start++;
cinfo->send_buffer_start %= t->fwd_queue_max;
- cinfo->send_buffer_n--;
+ }
+ else
+ {
+ cinfo->send_buffer_n++;
}
cinfo->send_buffer[i] = queue;
- cinfo->send_buffer_n++;
if (cinfo->send_buffer_n > t->fwd_queue_max)
{
GNUNET_break (0);
if (own_pos == size - 1)
{
/* It is for us! Send ack. */
- struct MeshTransmissionDescriptor *info;
-
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " It's for us!\n");
peer_info_add_path_to_origin (orig_peer_info, path, GNUNET_NO);
if (NULL == t->peers)
{
- /* New tunnel! Notify clients on data. */
+ /* New tunnel! Notify clients on first payload message. */
t->peers = GNUNET_CONTAINER_multihashmap_create (4);
}
GNUNET_break (GNUNET_SYSERR !=
peer_info_get
(&my_full_id),
GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
- info = GNUNET_malloc (sizeof (struct MeshTransmissionDescriptor));
- info->origin = &t->id;
- info->peer = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey);
- GNUNET_assert (NULL != info->peer);
- queue_add(info,
- GNUNET_MESSAGE_TYPE_MESH_PATH_ACK,
- sizeof (struct GNUNET_MESH_PathACK),
- info->peer,
- t);
+ send_path_ack (t);
}
else
{
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Own position: %u\n", own_pos);
if (own_pos < path->length - 1)
- send_message (message, &pi[own_pos + 1], t);
+ send_prebuilt_message (message, &pi[own_pos + 1], t);
else
send_client_tunnel_disconnect(t, NULL);
GNUNET_break_op (0);
return GNUNET_OK;
}
- send_message (message, neighbor, t);
+ send_prebuilt_message (message, neighbor, t);
GNUNET_STATISTICS_update (stats, "# unicast forwarded", 1, GNUNET_NO);
return GNUNET_OK;
}
return GNUNET_OK;
}
GNUNET_STATISTICS_update (stats, "# multicast forwarded", 1, GNUNET_NO);
- tunnel_send_multicast (t, message, GNUNET_NO);
+ tunnel_send_multicast (t, message);
return GNUNET_OK;
}
return GNUNET_OK;
}
GNUNET_PEER_resolve (tree_get_predecessor (t->tree), &id);
- send_message (message, &id, t);
+ send_prebuilt_message (message, &id, t);
GNUNET_STATISTICS_update (stats, "# to origin forwarded", 1, GNUNET_NO);
return GNUNET_OK;
GNUNET_break (0);
return GNUNET_OK;
}
- send_message (message, &id, t);
+ send_prebuilt_message (message, &id, t);
return GNUNET_OK;
}
tunnel_reset_timeout (t);
GNUNET_STATISTICS_update (stats, "# keepalives forwarded", 1, GNUNET_NO);
- tunnel_send_multicast (t, message, GNUNET_NO);
+ tunnel_send_multicast (t, message);
return GNUNET_OK;
}
msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_PATH_KEEPALIVE);
msg->oid = my_full_id;
msg->tid = htonl (t->id.tid);
- tunnel_send_multicast (t, &msg->header, GNUNET_YES);
+ tunnel_send_multicast (t, &msg->header);
t->path_refresh_task =
GNUNET_SCHEDULER_add_delayed (refresh_path_time, &path_refresh, t);
- return;
+ tunnel_reset_timeout(t);
}
while (NULL != q)
{
n = q->next;
- if (q->peer == pi)
- {
- /* try to reroute this traffic instead */
- queue_destroy(q, GNUNET_YES);
- }
+ /* TODO try to reroute this traffic instead */
+ queue_destroy(q, GNUNET_YES);
q = n;
}
+ if (NULL != pi->core_transmit)
+ {
+ GNUNET_CORE_notify_transmit_ready_cancel(pi->core_transmit);
+ pi->core_transmit = NULL;
+ }
peer_info_remove_path (pi, pi->id, myid);
if (myid == pi->id)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Mesh for peer [%s] FWD ACKs %u, BCK ACKs %u\n",
GNUNET_i2s(&my_full_id), debug_fwd_ack, debug_bck_ack);
-
return ret;
}