-minor fixes
authorChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2012 13:31:29 +0000 (13:31 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2012 13:31:29 +0000 (13:31 +0000)
src/util/client.c
src/util/connection.c

index 1b28e0577b2402ea44cc38e473ea548104d8fa17..e098f218331288617dcd4bdd07626d62a3e76cdb 100644 (file)
@@ -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);
   }
index 1e792adc88dd163143a84ddb7b362da034016b89..f6182ebbd9433fc096e6796a57b65a40f9c1f3cc 100644 (file)
@@ -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);