- shutdown other socket also
authorSree Harsha Totakura <totakura@in.tum.de>
Mon, 19 Nov 2012 15:18:59 +0000 (15:18 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Mon, 19 Nov 2012 15:18:59 +0000 (15:18 +0000)
src/stream/test_stream_local.c

index cb59de999789343852b676511449aee81bc7b1d0..be299cd06ea1c07556896365b0b1e7c35746e11b 100644 (file)
@@ -208,6 +208,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);
 }