aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-07-02 21:00:11 +0000
committerChristian Grothoff <christian@grothoff.org>2011-07-02 21:00:11 +0000
commitb862d290ab28a49c03a7b2a1adf85af17e8813b8 (patch)
tree87288709e0dcfe111854cfbfe4809c278f43fe55
parent71d648a0bfd6def8d7a28673169f9ee623b76702 (diff)
downloadgnunet-b862d290ab28a49c03a7b2a1adf85af17e8813b8.tar.gz
gnunet-b862d290ab28a49c03a7b2a1adf85af17e8813b8.zip
fixing 1714
-rw-r--r--src/transport/gnunet-service-transport.c57
1 files changed, 32 insertions, 25 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 4cae96273..b9e3e79b8 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -1854,6 +1854,22 @@ static void
1854mark_address_connected (struct ForeignAddressList *fal); 1854mark_address_connected (struct ForeignAddressList *fal);
1855 1855
1856 1856
1857
1858/**
1859 * We should re-try transmitting to the given peer,
1860 * hopefully we've learned something in the meantime.
1861 */
1862static void
1863retry_transmission_task (void *cls,
1864 const struct GNUNET_SCHEDULER_TaskContext *tc)
1865{
1866 struct NeighbourList *n = cls;
1867
1868 n->retry_task = GNUNET_SCHEDULER_NO_TASK;
1869 try_transmission_to_peer (n);
1870}
1871
1872
1857/** 1873/**
1858 * Function called by the GNUNET_TRANSPORT_TransmitFunction 1874 * Function called by the GNUNET_TRANSPORT_TransmitFunction
1859 * upon "completion" of a send request. This tells the API 1875 * upon "completion" of a send request. This tells the API
@@ -1925,33 +1941,24 @@ transmit_send_continuation (void *cls,
1925 if (! mq->internal_msg) 1941 if (! mq->internal_msg)
1926 mq->specific_address->in_transmit = GNUNET_NO; 1942 mq->specific_address->in_transmit = GNUNET_NO;
1927 } 1943 }
1928 n = find_neighbour(&mq->neighbour_id); 1944 n = find_neighbour (&mq->neighbour_id);
1929 if (mq->client != NULL) 1945 if (mq->client != NULL)
1930 transmit_send_ok (mq->client, n, target, result); 1946 transmit_send_ok (mq->client, n, target, result);
1931 if (n != NULL) 1947 if (n != NULL)
1932 { 1948 {
1933 GNUNET_CONTAINER_DLL_remove (n->cont_head, 1949 GNUNET_CONTAINER_DLL_remove (n->cont_head,
1934 n->cont_tail, 1950 n->cont_tail,
1935 mq); 1951 mq);
1936 } 1952 }
1937 GNUNET_free (mq); 1953 GNUNET_free (mq);
1938 if (n != NULL) 1954 if (n != NULL)
1939 try_transmission_to_peer (n); 1955 {
1940} 1956 if (result == GNUNET_OK)
1941 1957 try_transmission_to_peer (n);
1942 1958 else if (GNUNET_SCHEDULER_NO_TASK == n->retry_task)
1943/** 1959 n->retry_task = GNUNET_SCHEDULER_add_now (&retry_transmission_task,
1944 * We should re-try transmitting to the given peer, 1960 n);
1945 * hopefully we've learned something in the meantime. 1961 }
1946 */
1947static void
1948retry_transmission_task (void *cls,
1949 const struct GNUNET_SCHEDULER_TaskContext *tc)
1950{
1951 struct NeighbourList *n = cls;
1952
1953 n->retry_task = GNUNET_SCHEDULER_NO_TASK;
1954 try_transmission_to_peer (n);
1955} 1962}
1956 1963
1957 1964
@@ -2030,8 +2037,8 @@ try_transmission_to_peer (struct NeighbourList *n)
2030 if (n->retry_task != GNUNET_SCHEDULER_NO_TASK) 2037 if (n->retry_task != GNUNET_SCHEDULER_NO_TASK)
2031 GNUNET_SCHEDULER_cancel (n->retry_task); 2038 GNUNET_SCHEDULER_cancel (n->retry_task);
2032 n->retry_task = GNUNET_SCHEDULER_add_delayed (timeout, 2039 n->retry_task = GNUNET_SCHEDULER_add_delayed (timeout,
2033 &retry_transmission_task, 2040 &retry_transmission_task,
2034 n); 2041 n);
2035#if DEBUG_TRANSPORT 2042#if DEBUG_TRANSPORT
2036 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2043 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2037 "No validated destination address available to transmit message of size %u to peer `%4s', will wait %llums to find an address.\n", 2044 "No validated destination address available to transmit message of size %u to peer `%4s', will wait %llums to find an address.\n",