warnings
authorSree Harsha Totakura <totakura@in.tum.de>
Mon, 14 May 2012 13:04:48 +0000 (13:04 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Mon, 14 May 2012 13:04:48 +0000 (13:04 +0000)
src/stream/stream_api.c
src/stream/test_stream_2peers_halfclose.c

index e1fb8519063320cb44804f3191f3e08d28ca6c63..dadba33c5c536b219b73d05922a84e871ba093b9 100644 (file)
@@ -2920,8 +2920,16 @@ GNUNET_STREAM_close (struct GNUNET_STREAM_Socket *socket)
 {
   struct MessageQueue *head;
 
-  GNUNET_break (NULL == socket->read_handle);
-  GNUNET_break (NULL == socket->write_handle);
+  if (NULL != socket->read_handle)
+  {
+    LOG (GNUNET_ERROR_TYPE_WARNING,
+        "Closing STREAM socket when a read handle is pending\n");
+  }
+  if (NULL != socket->write_handle)
+  {
+    LOG (GNUNET_ERROR_TYPE_WARNING,
+        "Closing STREAM socket when a write handle is pending\n");
+  }
 
   if (socket->read_task_id != GNUNET_SCHEDULER_NO_TASK)
   {
index 227fbd31338bf6f520b1f6283c02b894eea1cfe3..f001dddc62934a52f52eaf829bf08ece7be8156e 100644 (file)
@@ -338,6 +338,8 @@ shutdown_completion (void *cls,
     case PEER1_WRITE:
       GNUNET_assert (0);
     case PEER1_WRITE_SHUTDOWN:
+      GNUNET_assert (cls == &peer1);
+      GNUNET_assert (SHUT_WR == operation);
       peer1.test_ok = GNUNET_YES;
       /* Peer2 should read with error */
       peer2.bytes_read = 0;