doc
authorSree Harsha Totakura <totakura@in.tum.de>
Thu, 4 Oct 2012 09:11:11 +0000 (09:11 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Thu, 4 Oct 2012 09:11:11 +0000 (09:11 +0000)
src/include/gnunet_stream_lib.h
src/stream/stream_api.c

index b1518d9ba233856ad776050a22e2c840ceb7b624..47486d76ba71efe23429b744ada5a5302acbf425 100644 (file)
@@ -349,9 +349,11 @@ typedef size_t (*GNUNET_STREAM_DataProcessor) (void *cls,
  * @param proc function to call with data (once only)
  * @param proc_cls the closure for proc
  *
- * @return handle to cancel the operation; if the stream has been shutdown for
- *           this type of opeartion then the DataProcessor is immediately
- *           called with GNUNET_STREAM_SHUTDOWN as status and NULL if returned
+ * @return handle to cancel the operation; NULL is returned if: the stream has
+ *           been shutdown for this type of opeartion (the DataProcessor is
+ *           immediately called with GNUNET_STREAM_SHUTDOWN as status) OR another
+ *           read handle is present (only one read handle per socket is present
+ *           at any time)
  */
 struct GNUNET_STREAM_IOReadHandle *
 GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket,
index e3ce7f88bb21bbf8fc2f16c62a912e854f6d08a0..5c72d74372c12846fa21f8b239910d08b67a405c 100644 (file)
@@ -2766,9 +2766,7 @@ tunnel_cleaner (void *cls,
 {
   struct GNUNET_STREAM_Socket *socket = tunnel_ctx;
 
-  if (tunnel != socket->tunnel)
-    return;
-
+  GNUNET_assert (tunnel == socket->tunnel);
   GNUNET_break_op(0);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "%s: Peer %s has terminated connection abruptly\n",
@@ -3376,9 +3374,11 @@ GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket,
  * @param proc function to call with data (once only)
  * @param proc_cls the closure for proc
  *
- * @return handle to cancel the operation; if the stream has been shutdown for
- *           this type of opeartion then the DataProcessor is immediately
- *           called with GNUNET_STREAM_SHUTDOWN as status and NULL if returned
+ * @return handle to cancel the operation; NULL is returned if: the stream has
+ *           been shutdown for this type of opeartion (the DataProcessor is
+ *           immediately called with GNUNET_STREAM_SHUTDOWN as status) OR another
+ *           read handle is present (only one read handle per socket is present
+ *           at any time)
  */
 struct GNUNET_STREAM_IOReadHandle *
 GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket,