diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-31 10:13:31 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-31 10:13:31 +0000 |
commit | 298d7b8528661d5dc52696a2997582414fac3c9c (patch) | |
tree | 935f5a3ac33f8917dd75a63254325d6c5b095833 | |
parent | e441f07b2c79ac5538b4714d8315a4eb47fa5965 (diff) | |
download | gnunet-298d7b8528661d5dc52696a2997582414fac3c9c.tar.gz gnunet-298d7b8528661d5dc52696a2997582414fac3c9c.zip |
fixes
-rw-r--r-- | src/include/gnunet_stream_lib.h | 7 | ||||
-rw-r--r-- | src/stream/stream_api.c | 24 |
2 files changed, 25 insertions, 6 deletions
diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h index 47486d76b..404844bce 100644 --- a/src/include/gnunet_stream_lib.h +++ b/src/include/gnunet_stream_lib.h | |||
@@ -124,10 +124,9 @@ enum GNUNET_STREAM_Option | |||
124 | GNUNET_STREAM_OPTION_LISTEN_TIMEOUT, | 124 | GNUNET_STREAM_OPTION_LISTEN_TIMEOUT, |
125 | 125 | ||
126 | /** | 126 | /** |
127 | * Option to register a callback when stream listening is | 127 | * Option to register a callback when stream listening is successfull. Takes |
128 | * successfull. Takes parameter of the form | 128 | * parameter of the form GNUNET_STREAM_ListenSuccessCallback. The callback |
129 | * GNUNET_STREAM_ListenSuccessCallback. The callback is only called if | 129 | * is only called if listening is successful |
130 | * listen is successful | ||
131 | */ | 130 | */ |
132 | GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS, | 131 | GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS, |
133 | 132 | ||
diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c index b712eb3d8..3abea2a49 100644 --- a/src/stream/stream_api.c +++ b/src/stream/stream_api.c | |||
@@ -2104,7 +2104,7 @@ server_handle_hello (void *cls, | |||
2104 | GNUNET_assert (socket->tunnel == tunnel); | 2104 | GNUNET_assert (socket->tunnel == tunnel); |
2105 | LOG_DEBUG ("%s: Received HELLO from %s\n", GNUNET_i2s (&socket->other_peer), | 2105 | LOG_DEBUG ("%s: Received HELLO from %s\n", GNUNET_i2s (&socket->other_peer), |
2106 | GNUNET_i2s (&socket->other_peer)); | 2106 | GNUNET_i2s (&socket->other_peer)); |
2107 | switch (socket->status) | 2107 | switch (socket->state) |
2108 | { | 2108 | { |
2109 | case STATE_INIT: | 2109 | case STATE_INIT: |
2110 | reply = generate_hello_ack (socket, GNUNET_YES); | 2110 | reply = generate_hello_ack (socket, GNUNET_YES); |
@@ -2765,6 +2765,7 @@ tunnel_cleaner (void *cls, | |||
2765 | void *tunnel_ctx) | 2765 | void *tunnel_ctx) |
2766 | { | 2766 | { |
2767 | struct GNUNET_STREAM_Socket *socket = tunnel_ctx; | 2767 | struct GNUNET_STREAM_Socket *socket = tunnel_ctx; |
2768 | struct MessageQueue *head; | ||
2768 | 2769 | ||
2769 | GNUNET_assert (tunnel == socket->tunnel); | 2770 | GNUNET_assert (tunnel == socket->tunnel); |
2770 | GNUNET_break_op(0); | 2771 | GNUNET_break_op(0); |
@@ -2789,8 +2790,27 @@ tunnel_cleaner (void *cls, | |||
2789 | { | 2790 | { |
2790 | GNUNET_SCHEDULER_cancel (socket->data_retransmission_task_id); | 2791 | GNUNET_SCHEDULER_cancel (socket->data_retransmission_task_id); |
2791 | socket->data_retransmission_task_id = GNUNET_SCHEDULER_NO_TASK; | 2792 | socket->data_retransmission_task_id = GNUNET_SCHEDULER_NO_TASK; |
2793 | } | ||
2794 | /* Terminate the control retransmission tasks */ | ||
2795 | if (GNUNET_SCHEDULER_NO_TASK != socket->control_retransmission_task_id) | ||
2796 | { | ||
2797 | GNUNET_SCHEDULER_cancel (socket->control_retransmission_task_id); | ||
2798 | socket->control_retransmission_task_id = GNUNET_SCHEDULER_NO_TASK; | ||
2799 | } | ||
2800 | /* Clear Transmit handles */ | ||
2801 | if (NULL != socket->transmit_handle) | ||
2802 | { | ||
2803 | GNUNET_MESH_notify_transmit_ready_cancel (socket->transmit_handle); | ||
2804 | socket->transmit_handle = NULL; | ||
2805 | } | ||
2806 | /* Clear existing message queue */ | ||
2807 | while (NULL != (head = socket->queue_head)) { | ||
2808 | GNUNET_CONTAINER_DLL_remove (socket->queue_head, | ||
2809 | socket->queue_tail, | ||
2810 | head); | ||
2811 | GNUNET_free (head->message); | ||
2812 | GNUNET_free (head); | ||
2792 | } | 2813 | } |
2793 | /* FIXME: Cancel all other tasks using socket->tunnel */ | ||
2794 | socket->tunnel = NULL; | 2814 | socket->tunnel = NULL; |
2795 | } | 2815 | } |
2796 | 2816 | ||