aboutsummaryrefslogtreecommitdiff
path: root/src/stream
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-09-30 14:02:30 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-09-30 14:02:30 +0000
commitbe0b41ff6eaa768b489440db2be15a1bb1489d43 (patch)
tree6f39283d71c42f9173fb8d051db1b4dff1c4534b /src/stream
parent65a3e31d9bcaa76c1dc8ba7a7861851e9616a199 (diff)
downloadgnunet-be0b41ff6eaa768b489440db2be15a1bb1489d43.tar.gz
gnunet-be0b41ff6eaa768b489440db2be15a1bb1489d43.zip
fixes for #2570
Diffstat (limited to 'src/stream')
-rw-r--r--src/stream/test_stream_2peers_halfclose.c10
-rw-r--r--src/stream/test_stream_big.c3
-rw-r--r--src/stream/test_stream_local.c3
-rw-r--r--src/stream/test_stream_sequence_wraparound.c3
4 files changed, 14 insertions, 5 deletions
diff --git a/src/stream/test_stream_2peers_halfclose.c b/src/stream/test_stream_2peers_halfclose.c
index e089a22a1..2d14acfe3 100644
--- a/src/stream/test_stream_2peers_halfclose.c
+++ b/src/stream/test_stream_2peers_halfclose.c
@@ -334,7 +334,10 @@ do_close (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
334 GNUNET_STREAM_close (peer2.socket); 334 GNUNET_STREAM_close (peer2.socket);
335 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 335 if (GNUNET_SCHEDULER_NO_TASK != abort_task)
336 GNUNET_SCHEDULER_cancel (abort_task); 336 GNUNET_SCHEDULER_cancel (abort_task);
337 GNUNET_TESTBED_operation_done (peer2.op); 337 if (NULL != peer2.op)
338 GNUNET_TESTBED_operation_done (peer2.op);
339 else
340 GNUNET_SCHEDULER_shutdown (); /* For shutting down testbed */
338} 341}
339 342
340 343
@@ -697,7 +700,10 @@ stream_da (void *cls, void *op_result)
697 { 700 {
698 lsocket = op_result; 701 lsocket = op_result;
699 GNUNET_STREAM_listen_close (lsocket); 702 GNUNET_STREAM_listen_close (lsocket);
700 GNUNET_TESTBED_operation_done (peer1.op); 703 if (NULL != peer1.op)
704 GNUNET_TESTBED_operation_done (peer1.op);
705 else
706 GNUNET_SCHEDULER_shutdown ();
701 return; 707 return;
702 } 708 }
703 if (&peer1 == cls) 709 if (&peer1 == cls)
diff --git a/src/stream/test_stream_big.c b/src/stream/test_stream_big.c
index 35302182a..19c7e571a 100644
--- a/src/stream/test_stream_big.c
+++ b/src/stream/test_stream_big.c
@@ -90,7 +90,8 @@ static int result;
90static void 90static void
91do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 91do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
92{ 92{
93 GNUNET_STREAM_close (peer1.socket); 93 if (NULL != peer1.socket)
94 GNUNET_STREAM_close (peer1.socket);
94 if (NULL != peer2.socket) 95 if (NULL != peer2.socket)
95 GNUNET_STREAM_close (peer2.socket); 96 GNUNET_STREAM_close (peer2.socket);
96 if (NULL != peer2_listen_socket) 97 if (NULL != peer2_listen_socket)
diff --git a/src/stream/test_stream_local.c b/src/stream/test_stream_local.c
index af1b8ff84..699bc8032 100644
--- a/src/stream/test_stream_local.c
+++ b/src/stream/test_stream_local.c
@@ -168,7 +168,8 @@ stream_write_task (void *cls,
168static void 168static void
169do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 169do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
170{ 170{
171 GNUNET_STREAM_close (peer1.socket); 171 if (NULL != peer1.socket)
172 GNUNET_STREAM_close (peer1.socket);
172 if (NULL != peer2.socket) 173 if (NULL != peer2.socket)
173 GNUNET_STREAM_close (peer2.socket); 174 GNUNET_STREAM_close (peer2.socket);
174 if (NULL != peer2_listen_socket) 175 if (NULL != peer2_listen_socket)
diff --git a/src/stream/test_stream_sequence_wraparound.c b/src/stream/test_stream_sequence_wraparound.c
index 1e5156fe9..8f35a41d3 100644
--- a/src/stream/test_stream_sequence_wraparound.c
+++ b/src/stream/test_stream_sequence_wraparound.c
@@ -95,7 +95,8 @@ static int result;
95static void 95static void
96do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 96do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
97{ 97{
98 GNUNET_STREAM_close (peer1.socket); 98 if (NULL != peer1.socket)
99 GNUNET_STREAM_close (peer1.socket);
99 if (NULL != peer2.socket) 100 if (NULL != peer2.socket)
100 GNUNET_STREAM_close (peer2.socket); 101 GNUNET_STREAM_close (peer2.socket);
101 if (NULL != peer2_listen_socket) 102 if (NULL != peer2_listen_socket)