aboutsummaryrefslogtreecommitdiff
path: root/src/stream
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-11-19 15:34:20 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-11-19 15:34:20 +0000
commit1d65d71fb25ec9281f69ea4df5c907d79878d840 (patch)
tree30384b257b009cb2f45a57bb8f19f55d180ccf0e /src/stream
parente3e9e10ff8fa9e926135a8d4ed20ed356cb86ea7 (diff)
downloadgnunet-1d65d71fb25ec9281f69ea4df5c907d79878d840.tar.gz
gnunet-1d65d71fb25ec9281f69ea4df5c907d79878d840.zip
- merged r25055
Diffstat (limited to 'src/stream')
-rw-r--r--src/stream/perf_stream_api.c9
-rw-r--r--src/stream/test_stream_2peers.c9
-rw-r--r--src/stream/test_stream_big.c9
-rw-r--r--src/stream/test_stream_sequence_wraparound.c9
4 files changed, 36 insertions, 0 deletions
diff --git a/src/stream/perf_stream_api.c b/src/stream/perf_stream_api.c
index cd68310bc..310e4c5ef 100644
--- a/src/stream/perf_stream_api.c
+++ b/src/stream/perf_stream_api.c
@@ -439,6 +439,15 @@ static void
439shutdown_completion (void *cls, 439shutdown_completion (void *cls,
440 int operation) 440 int operation)
441{ 441{
442 static int shutdowns;
443
444 if (++shutdowns == 1)
445 {
446 peer_data[0].shutdown_handle = NULL;
447 peer_data[1].shutdown_handle = GNUNET_STREAM_shutdown (peer_data[1].socket, SHUT_RDWR,
448 &shutdown_completion, cls);
449 return;
450 }
442 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); 451 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n");
443 GNUNET_SCHEDULER_add_now (&do_close, cls); 452 GNUNET_SCHEDULER_add_now (&do_close, cls);
444} 453}
diff --git a/src/stream/test_stream_2peers.c b/src/stream/test_stream_2peers.c
index d059d0521..3ddd1aa46 100644
--- a/src/stream/test_stream_2peers.c
+++ b/src/stream/test_stream_2peers.c
@@ -259,6 +259,15 @@ static void
259shutdown_completion (void *cls, 259shutdown_completion (void *cls,
260 int operation) 260 int operation)
261{ 261{
262 static int shutdowns;
263
264 if (++shutdowns == 1)
265 {
266 peer1.shutdown_handle = NULL;
267 peer2.shutdown_handle = GNUNET_STREAM_shutdown (peer2.socket, SHUT_RDWR,
268 &shutdown_completion, cls);
269 return;
270 }
262 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); 271 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n");
263 GNUNET_SCHEDULER_add_now (&do_close, cls); 272 GNUNET_SCHEDULER_add_now (&do_close, cls);
264} 273}
diff --git a/src/stream/test_stream_big.c b/src/stream/test_stream_big.c
index d5875dd55..1546c9672 100644
--- a/src/stream/test_stream_big.c
+++ b/src/stream/test_stream_big.c
@@ -132,6 +132,15 @@ static void
132shutdown_completion (void *cls, 132shutdown_completion (void *cls,
133 int operation) 133 int operation)
134{ 134{
135 static int shutdowns;
136
137 if (++shutdowns == 1)
138 {
139 peer1.shutdown_handle = NULL;
140 peer2.shutdown_handle = GNUNET_STREAM_shutdown (peer2.socket, SHUT_RDWR,
141 &shutdown_completion, cls);
142 return;
143 }
135 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); 144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n");
136 GNUNET_SCHEDULER_add_now (&do_close, cls); 145 GNUNET_SCHEDULER_add_now (&do_close, cls);
137} 146}
diff --git a/src/stream/test_stream_sequence_wraparound.c b/src/stream/test_stream_sequence_wraparound.c
index 61e28cf72..1e1cfa3bc 100644
--- a/src/stream/test_stream_sequence_wraparound.c
+++ b/src/stream/test_stream_sequence_wraparound.c
@@ -139,6 +139,15 @@ static void
139shutdown_completion (void *cls, 139shutdown_completion (void *cls,
140 int operation) 140 int operation)
141{ 141{
142 static int shutdowns;
143
144 if (++shutdowns == 1)
145 {
146 peer1.shutdown_handle = NULL;
147 peer2.shutdown_handle = GNUNET_STREAM_shutdown (peer2.socket, SHUT_RDWR,
148 &shutdown_completion, cls);
149 return;
150 }
142 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); 151 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n");
143 GNUNET_SCHEDULER_add_now (&do_close, cls); 152 GNUNET_SCHEDULER_add_now (&do_close, cls);
144} 153}