struct MeshTunnel *t;
/**
- * Destination peer
+ * Neighbouring peer to whom we send the packet to
*/
struct MeshPeerInfo *peer;
struct MeshDataDescriptor *dd;
struct MeshPathInfo *path_info;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "MESH: Cancelling data transmission at %u\n",
- i);
- GNUNET_CORE_notify_transmit_ready_cancel (peer->core_transmit[i]);
- peer->core_transmit[i] = NULL;
+#if MESH_DEBUG
+ {
+ struct GNUNET_PeerIdentity id;
+
+ GNUNET_PEER_resolve (peer->id, &id);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: Cancelling data transmission at %s [%u]\n",
+ GNUNET_i2s (&id),
+ i);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: message type %u\n",
+ peer->types[i]);
+ }
+#endif
/* TODO: notify that tranmission has failed */
switch (peer->types[i])
{
path_info = peer->infos[i];
path_destroy(path_info->path);
break;
+ default:
+ GNUNET_break (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: type unknown!\n");
}
+ GNUNET_CORE_notify_transmit_ready_cancel (peer->core_transmit[i]);
+ peer->core_transmit[i] = NULL;
GNUNET_free (peer->infos[i]);
}
}
path_info = GNUNET_malloc (sizeof (struct MeshPathInfo));
path_info->path = p;
- path_info->peer = peer;
path_info->t = t;
neighbor = peer_info_get(&id);
+ path_info->peer = neighbor;
path_info->pos = peer_info_transmit_slot(neighbor);
neighbor->types[path_info->pos] = GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE;
neighbor->infos[path_info->pos] = path_info;
size_t size_needed;
int i;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: CREATE PATH sending...\n");
size_needed =
sizeof (struct GNUNET_MESH_ManipulatePath) +
p->length * sizeof (struct GNUNET_PeerIdentity);
return 0;
}
info->peer->core_transmit[info->pos] = NULL;
+#if MESH_DEBUG
+ {
+ struct GNUNET_PeerIdentity id;
+ GNUNET_PEER_resolve (peer->id, &id);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "MESH: setting core_transmit %s [%u] to NULL\n",
+ GNUNET_i2s (&id),
+ info->pos);
+ }
+#endif
msg = (struct GNUNET_MESH_ManipulatePath *) buf;
msg->header.size = htons (size_needed);
msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_PATH_CREATE);
{
if (NULL != info->client)
{
- /* FIXME One unresponsive neighbor (who doesn't "call" tmt_rdy) can lock
- * the client from sending anything else to the service.
- * - Call receive_done after certain timeout.
- * - Here cancel the timeout.
- */
+ if (GNUNET_SCHEDULER_NO_TASK != info->timeout_task)
+ GNUNET_SCHEDULER_cancel(info->timeout_task);
GNUNET_SERVER_receive_done (info->client, GNUNET_OK);
}
GNUNET_free (info->data);
struct GNUNET_MESH_Multicast *msg;
size_t size;
- t->path_refresh_task = GNUNET_SCHEDULER_NO_TASK;
if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
{
return;
}
+ t->path_refresh_task = GNUNET_SCHEDULER_NO_TASK;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"MESH: sending keepalive for tunnel %d\n",