From 1d65d71fb25ec9281f69ea4df5c907d79878d840 Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Mon, 19 Nov 2012 15:34:20 +0000 Subject: [PATCH] - merged r25055 --- src/stream/perf_stream_api.c | 9 +++++++++ src/stream/test_stream_2peers.c | 9 +++++++++ src/stream/test_stream_big.c | 9 +++++++++ src/stream/test_stream_sequence_wraparound.c | 9 +++++++++ 4 files changed, 36 insertions(+) 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 shutdown_completion (void *cls, int operation) { + static int shutdowns; + + if (++shutdowns == 1) + { + peer_data[0].shutdown_handle = NULL; + peer_data[1].shutdown_handle = GNUNET_STREAM_shutdown (peer_data[1].socket, SHUT_RDWR, + &shutdown_completion, cls); + return; + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); GNUNET_SCHEDULER_add_now (&do_close, cls); } 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 shutdown_completion (void *cls, int operation) { + static int shutdowns; + + if (++shutdowns == 1) + { + peer1.shutdown_handle = NULL; + peer2.shutdown_handle = GNUNET_STREAM_shutdown (peer2.socket, SHUT_RDWR, + &shutdown_completion, cls); + return; + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); GNUNET_SCHEDULER_add_now (&do_close, cls); } 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 shutdown_completion (void *cls, int operation) { + static int shutdowns; + + if (++shutdowns == 1) + { + peer1.shutdown_handle = NULL; + peer2.shutdown_handle = GNUNET_STREAM_shutdown (peer2.socket, SHUT_RDWR, + &shutdown_completion, cls); + return; + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); GNUNET_SCHEDULER_add_now (&do_close, cls); } 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 shutdown_completion (void *cls, int operation) { + static int shutdowns; + + if (++shutdowns == 1) + { + peer1.shutdown_handle = NULL; + peer2.shutdown_handle = GNUNET_STREAM_shutdown (peer2.socket, SHUT_RDWR, + &shutdown_completion, cls); + return; + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "STREAM shutdown successful\n"); GNUNET_SCHEDULER_add_now (&do_close, cls); } -- 2.25.1