static void try_transmission_to_peer (struct NeighbourList *neighbour);
+/**
+ * The peer specified by the given neighbour has timed-out. Update
+ * our state and do the necessary notifications. Also notifies
+ * our clients that the neighbour is now officially gone.
+ *
+ * @param n the neighbour list entry for the peer
+ */
+static void
+disconnect_neighbour (struct NeighbourList *n);
+
+
/**
* Function called by the GNUNET_TRANSPORT_TransmitFunction
* upon "completion" of a send request. This tells the API
GNUNET_free (mq);
/* one plugin just became ready again, try transmitting
another message (if available) */
- try_transmission_to_peer (n);
+ if (result == GNUNET_OK)
+ try_transmission_to_peer (n);
+ else
+ disconnect_neighbour (n);
}
}
+/**
+ * FIXME: document.
+ */
struct GeneratorContext
{
struct TransportPlugin *plug_pos;
};
+/**
+ * FIXME: document.
+ */
static size_t
address_generator (void *cls, size_t max, void *buf)
{
}
+/**
+ * FIXME: document.
+ */
struct LookupHelloContext
{
GNUNET_TRANSPORT_AddressCallback iterator;
};
+/**
+ * FIXME: document.
+ */
static int
lookup_address_callback (void *cls,
const char *tname,
}
+/**
+ * FIXME: document.
+ */
static void
lookup_hello_callback (void *cls,
const struct GNUNET_PeerIdentity *peer,
}
-
/**
* The peer specified by the given neighbour has timed-out. Update
* our state and do the necessary notifications. Also notifies
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
- "Disconnecting from neighbour\n");
+ "Disconnecting from `%4s'\n",
+ GNUNET_i2s(&n->id));
#endif
/* remove n from neighbours list */
nprev = NULL;
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
- "Neighbour has timed out!\n");
+ "Neighbour `%4s' has timed out!\n",
+ GNUNET_i2s(&n->id));
#endif
n->timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK;
disconnect_neighbour (n);
}
-
/**
* Create a fresh entry in our neighbour list for the given peer.
* Will try to transmit our current HELLO to the new neighbour. Also
#endif
if (NULL == find_neighbour (&tcm->peer))
setup_new_neighbour (&tcm->peer);
+#if DEBUG_TRANSPORT
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Client asked to connect to `%4s', but connection already exists\n",
+ "TRY_CONNECT",
+ GNUNET_i2s (&tcm->peer));
+#endif
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}