From 8ddd3c314faec2c7f0fe9c0fe7816ca5be54011d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 24 Apr 2012 13:31:29 +0000 Subject: [PATCH] -minor fixes --- src/util/client.c | 3 ++- src/util/connection.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/client.c b/src/util/client.c index 1b28e0577..e098f2183 100644 --- a/src/util/client.c +++ b/src/util/client.c @@ -465,6 +465,7 @@ receive_helper (void *cls, const void *buf, size_t available, void *receive_handler_cls; GNUNET_assert (GNUNET_NO == client->msg_complete); + GNUNET_assert (GNUNET_YES == client->in_receive); client->in_receive = GNUNET_NO; if ((0 == available) || (NULL == client->connection) || (0 != errCode)) { @@ -572,9 +573,9 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *client, } else { + LOG (GNUNET_ERROR_TYPE_DEBUG, "calling GNUNET_CONNECTION_receive\n"); GNUNET_assert (GNUNET_NO == client->in_receive); client->in_receive = GNUNET_YES; - LOG (GNUNET_ERROR_TYPE_DEBUG, "calling GNUNET_CONNECTION_receive\n"); GNUNET_CONNECTION_receive (client->connection, GNUNET_SERVER_MAX_MESSAGE_SIZE - 1, timeout, &receive_helper, client); } diff --git a/src/util/connection.c b/src/util/connection.c index 1e792adc8..f6182ebbd 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -1064,7 +1064,7 @@ RETRY: * * @param connection connection handle * @param max maximum number of bytes to read - * @param timeout maximum amount of time to wait (use -1 for "forever") + * @param timeout maximum amount of time to wait * @param receiver function to call with received data * @param receiver_cls closure for receiver */ @@ -1076,6 +1076,7 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, size_t m { GNUNET_assert ((GNUNET_SCHEDULER_NO_TASK == connection->read_task) && (NULL == connection->receiver)); + GNUNET_assert (NULL != receiver); connection->receiver = receiver; connection->receiver_cls = receiver_cls; connection->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout); -- 2.25.1