/**
* How many messages do we accept in the queue.
+ * If 0, the connection is broken in this direction (next hop disconnected).
*/
unsigned int queue_max;
LOG (GNUNET_ERROR_TYPE_DEBUG, "POLL canceled on shutdown\n");
return;
}
+ if (0 == fc->queue_max)
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "POLL cancelled: neighbor disconnected\n");
+ return;
+ }
LOG (GNUNET_ERROR_TYPE_DEBUG, "POLL sent for %s, scheduling new one!\n",
GCC_2s (c));
GNUNET_assert (NULL == fc->poll_task);
void
GCC_neighbor_disconnected (struct CadetConnection *c, struct CadetPeer *peer)
{
+ struct CadetFlowControl *fc;
struct CadetPeer *hop;
char peer_name[16];
int fwd;
GCC_check_connections ();
return;
}
+ /* Mark FlowControl towards the peer as unavaliable. */
+ fc = fwd ? &c->bck_fc : &c->fwd_fc;
+ fc->queue_max = 0;
+
send_broken (c, &my_full_id, GCP_get_id (peer), fwd);
+
/* Connection will have at least one pending message
* (the one we just scheduled), so delay destruction
* and remove from map so we don't use accidentally. */
fc->poll_task, fc->poll_msg);
return;
}
+ if (0 == fc->queue_max)
+ {
+ /* Should not be needed, traffic should've been cancelled. */
+ GNUNET_break (0);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " POLL not possible, peer disconnected\n");
+ return;
+ }
LOG (GNUNET_ERROR_TYPE_DEBUG, "POLL started on request\n");
fc->poll_task = GNUNET_SCHEDULER_add_delayed (fc->poll_time,
&connection_poll,