aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-03-10 09:13:20 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-03-10 09:13:20 +0000
commit532493cd0d5c9aaf4a169e6f609d1c91dbc5b677 (patch)
tree0cccd7ca0c2c47335a3a5b0bed83bd8db7efc861 /src
parentbc0d9306ab4f28caf4515d6cf1fd67b111f32246 (diff)
downloadgnunet-532493cd0d5c9aaf4a169e6f609d1c91dbc5b677.tar.gz
gnunet-532493cd0d5c9aaf4a169e6f609d1c91dbc5b677.zip
fixed retransmission task
Diffstat (limited to 'src')
-rw-r--r--src/stream/stream_api.c21
-rw-r--r--src/stream/test_stream_local.c5
2 files changed, 19 insertions, 7 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;
diff --git a/src/stream/test_stream_local.c b/src/stream/test_stream_local.c
index af4e057d7..125fc6df8 100644
--- a/src/stream/test_stream_local.c
+++ b/src/stream/test_stream_local.c
@@ -204,6 +204,9 @@ write_completion (void *cls,
204 GNUNET_assert (size <= strlen (data)); 204 GNUNET_assert (size <= strlen (data));
205 peer->bytes_wrote += size; 205 peer->bytes_wrote += size;
206 206
207 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
208 "Writing completed\n");
209
207 if (peer->bytes_wrote < strlen(data)) /* Have more data to send */ 210 if (peer->bytes_wrote < strlen(data)) /* Have more data to send */
208 { 211 {
209 peer->io_write_handle = 212 peer->io_write_handle =
@@ -319,7 +322,7 @@ input_processor (void *cls,
319 { 322 {
320 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 323 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
321 } 324 }
322 } 325 }
323 return size; 326 return size;
324} 327}
325 328