- receiver (connection->receiver_cls, buffer, ret, connection->addr, connection->addrlen, 0);
-}
-
-
-/**
- * This function is called after establishing a connection either has
- * succeeded or timed out. Note that it is possible that the attempt
- * timed out and that we're immediately retrying. If we are retrying,
- * we need to wait again (or timeout); if we succeeded, we need to
- * wait for data (or timeout).
- *
- * @param cls our connection handle
- * @param tc task context describing why we are here
- */
-static void
-receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- struct GNUNET_CONNECTION_Handle *connection = cls;
- struct GNUNET_TIME_Absolute now;
-
- connection->read_task = GNUNET_SCHEDULER_NO_TASK;
- if (connection->sock == NULL)
- {
- /* not connected and no longer trying */
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Receive encounters error, connection closed (%p)...\n", connection);
- signal_error (connection, ECONNREFUSED);
- return;
- }
- now = GNUNET_TIME_absolute_get ();
- if ((now.abs_value > connection->receive_timeout.abs_value) ||
- (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)))
- {
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Receive encounters error: time out (%p)...\n", connection);
- signal_timeout (connection);
- return;
- }
- GNUNET_assert (connection->sock != NULL);
- /* connect succeeded, wait for data! */
- connection->read_task =
- GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_absolute_get_remaining
- (connection->receive_timeout), connection->sock,
- &receive_ready, connection);