[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r15824 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r15824 - gnunet/src/transport |
Date: |
Sat, 2 Jul 2011 23:00:11 +0200 |
Author: grothoff
Date: 2011-07-02 23:00:11 +0200 (Sat, 02 Jul 2011)
New Revision: 15824
Modified:
gnunet/src/transport/gnunet-service-transport.c
Log:
fixing 1714
Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c 2011-07-02 20:02:00 UTC
(rev 15823)
+++ gnunet/src/transport/gnunet-service-transport.c 2011-07-02 21:00:11 UTC
(rev 15824)
@@ -1854,7 +1854,23 @@
mark_address_connected (struct ForeignAddressList *fal);
+
/**
+ * We should re-try transmitting to the given peer,
+ * hopefully we've learned something in the meantime.
+ */
+static void
+retry_transmission_task (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct NeighbourList *n = cls;
+
+ n->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ try_transmission_to_peer (n);
+}
+
+
+/**
* Function called by the GNUNET_TRANSPORT_TransmitFunction
* upon "completion" of a send request. This tells the API
* that it is now legal to send another message to the given
@@ -1925,37 +1941,28 @@
if (! mq->internal_msg)
mq->specific_address->in_transmit = GNUNET_NO;
}
- n = find_neighbour(&mq->neighbour_id);
+ n = find_neighbour (&mq->neighbour_id);
if (mq->client != NULL)
transmit_send_ok (mq->client, n, target, result);
if (n != NULL)
- {
- GNUNET_CONTAINER_DLL_remove (n->cont_head,
- n->cont_tail,
- mq);
- }
+ {
+ GNUNET_CONTAINER_DLL_remove (n->cont_head,
+ n->cont_tail,
+ mq);
+ }
GNUNET_free (mq);
- if (n != NULL)
- try_transmission_to_peer (n);
+ if (n != NULL)
+ {
+ if (result == GNUNET_OK)
+ try_transmission_to_peer (n);
+ else if (GNUNET_SCHEDULER_NO_TASK == n->retry_task)
+ n->retry_task = GNUNET_SCHEDULER_add_now (&retry_transmission_task,
+ n);
+ }
}
/**
- * We should re-try transmitting to the given peer,
- * hopefully we've learned something in the meantime.
- */
-static void
-retry_transmission_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- struct NeighbourList *n = cls;
-
- n->retry_task = GNUNET_SCHEDULER_NO_TASK;
- try_transmission_to_peer (n);
-}
-
-
-/**
* Check the ready list for the given neighbour and if a plugin is
* ready for transmission (and if we have a message), do so!
*
@@ -2030,8 +2037,8 @@
if (n->retry_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (n->retry_task);
n->retry_task = GNUNET_SCHEDULER_add_delayed (timeout,
-
&retry_transmission_task,
- n);
+ &retry_transmission_task,
+ n);
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"No validated destination address available to transmit
message of size %u to peer `%4s', will wait %llums to find an address.\n",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r15824 - gnunet/src/transport,
gnunet <=