From 5a8c980e27163987553d4754dddb7902bcfd0f92 Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Mon, 14 May 2012 13:04:48 +0000 Subject: [PATCH] warnings --- src/stream/stream_api.c | 12 ++++++++++-- src/stream/test_stream_2peers_halfclose.c | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c index e1fb85190..dadba33c5 100644 --- a/src/stream/stream_api.c +++ b/src/stream/stream_api.c @@ -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) { diff --git a/src/stream/test_stream_2peers_halfclose.c b/src/stream/test_stream_2peers_halfclose.c index 227fbd313..f001dddc6 100644 --- a/src/stream/test_stream_2peers_halfclose.c +++ b/src/stream/test_stream_2peers_halfclose.c @@ -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; -- 2.25.1