diff options
Diffstat (limited to 'src/stream/stream_api.c')
-rw-r--r-- | src/stream/stream_api.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c index bb50f69bc..d488b4c80 100644 --- a/src/stream/stream_api.c +++ b/src/stream/stream_api.c | |||
@@ -791,10 +791,12 @@ write_data (struct GNUNET_STREAM_Socket *socket) | |||
791 | packet++; | 791 | packet++; |
792 | } | 792 | } |
793 | 793 | ||
794 | GNUNET_SCHEDULER_add_delayed | 794 | if (GNUNET_SCHEDULER_NO_TASK == socket->retransmission_timeout_task_id) |
795 | (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5), | 795 | socket->retransmission_timeout_task_id = |
796 | &retransmission_timeout_task, | 796 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
797 | socket); | 797 | (GNUNET_TIME_UNIT_SECONDS, 5), |
798 | &retransmission_timeout_task, | ||
799 | socket); | ||
798 | } | 800 | } |
799 | 801 | ||
800 | 802 | ||
@@ -1837,6 +1839,11 @@ handle_ack (struct GNUNET_STREAM_Socket *socket, | |||
1837 | } | 1839 | } |
1838 | /* FIXME: include the case when write_handle is cancelled - ignore the | 1840 | /* FIXME: include the case when write_handle is cancelled - ignore the |
1839 | acks */ | 1841 | acks */ |
1842 | |||
1843 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1844 | "%x: Received DATA_ACK from %x\n", | ||
1845 | socket->our_id, | ||
1846 | socket->other_peer); | ||
1840 | 1847 | ||
1841 | /* Cancel the retransmission task */ | 1848 | /* Cancel the retransmission task */ |
1842 | if (GNUNET_SCHEDULER_NO_TASK != socket->retransmission_timeout_task_id) | 1849 | if (GNUNET_SCHEDULER_NO_TASK != socket->retransmission_timeout_task_id) |
@@ -1845,7 +1852,7 @@ handle_ack (struct GNUNET_STREAM_Socket *socket, | |||
1845 | socket->retransmission_timeout_task_id = | 1852 | socket->retransmission_timeout_task_id = |
1846 | GNUNET_SCHEDULER_NO_TASK; | 1853 | GNUNET_SCHEDULER_NO_TASK; |
1847 | } | 1854 | } |
1848 | 1855 | ||
1849 | socket->write_handle->ack_bitmap = GNUNET_ntohll (ack->bitmap); | 1856 | socket->write_handle->ack_bitmap = GNUNET_ntohll (ack->bitmap); |
1850 | socket->receiver_window_available = | 1857 | socket->receiver_window_available = |
1851 | ntohl (ack->receive_window_remaining); | 1858 | ntohl (ack->receive_window_remaining); |
@@ -1868,7 +1875,6 @@ handle_ack (struct GNUNET_STREAM_Socket *socket, | |||
1868 | } | 1875 | } |
1869 | else /* We have to call the write continuation callback now */ | 1876 | else /* We have to call the write continuation callback now */ |
1870 | { | 1877 | { |
1871 | |||
1872 | /* Free the packets */ | 1878 | /* Free the packets */ |
1873 | for (packet=0; packet < 64; packet++) | 1879 | for (packet=0; packet < 64; packet++) |
1874 | { | 1880 | { |
@@ -1879,6 +1885,9 @@ handle_ack (struct GNUNET_STREAM_Socket *socket, | |||
1879 | (socket->write_handle->write_cont_cls, | 1885 | (socket->write_handle->write_cont_cls, |
1880 | socket->status, | 1886 | socket->status, |
1881 | socket->write_handle->size); | 1887 | socket->write_handle->size); |
1888 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1889 | "%x: Write completion callback completed\n", | ||
1890 | socket->our_id); | ||
1882 | /* We are done with the write handle - Freeing it */ | 1891 | /* We are done with the write handle - Freeing it */ |
1883 | GNUNET_free (socket->write_handle); | 1892 | GNUNET_free (socket->write_handle); |
1884 | socket->write_handle = NULL; | 1893 | socket->write_handle = NULL; |