aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_stream_lib.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-12-10 14:11:53 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-12-10 14:11:53 +0000
commit3ccfd30802db0ff457cecef92609aa21c4728a4c (patch)
tree04ec4b9b4aedbebed12779f8d0c943e39d2abdc3 /src/include/gnunet_stream_lib.h
parent97d68f4f7c1f9b37e92550ac74ba8fa4315a97c1 (diff)
downloadgnunet-3ccfd30802db0ff457cecef92609aa21c4728a4c.tar.gz
gnunet-3ccfd30802db0ff457cecef92609aa21c4728a4c.zip
fix 2672
Diffstat (limited to 'src/include/gnunet_stream_lib.h')
-rw-r--r--src/include/gnunet_stream_lib.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h
index d81218364..7097f8a5b 100644
--- a/src/include/gnunet_stream_lib.h
+++ b/src/include/gnunet_stream_lib.h
@@ -46,29 +46,23 @@ enum GNUNET_STREAM_Status
46 /** 46 /**
47 * All previous read/write operations are successfully done 47 * All previous read/write operations are successfully done
48 */ 48 */
49 GNUNET_STREAM_OK = 0, 49 GNUNET_STREAM_OK,
50 50
51 /** 51 /**
52 * A timeout occured while reading/writing the stream 52 * A timeout occured while reading/writing the stream
53 */ 53 */
54 GNUNET_STREAM_TIMEOUT = 1, 54 GNUNET_STREAM_TIMEOUT,
55 55
56 /** 56 /**
57 * Other side has shutdown the socket for this type of operation 57 * Other side has shutdown the socket for this type of operation
58 * (reading/writing) 58 * (reading/writing)
59 */ 59 */
60 GNUNET_STREAM_SHUTDOWN = 2, 60 GNUNET_STREAM_SHUTDOWN,
61 61
62 /** 62 /**
63 * A serious error occured while operating on this stream 63 * A serious error occured while operating on this stream
64 */ 64 */
65 GNUNET_STREAM_SYSERR = 3, 65 GNUNET_STREAM_SYSERR
66
67 /**
68 * An error resulted in an unusable stream
69 * FIXME: status code unused?
70 */
71 GNUNET_STREAM_BROKEN
72 }; 66 };
73 67
74/** 68/**
@@ -279,9 +273,13 @@ GNUNET_STREAM_listen_close (struct GNUNET_STREAM_ListenSocket *lsocket);
279 * 273 *
280 * @param cls the closure from GNUNET_STREAM_write 274 * @param cls the closure from GNUNET_STREAM_write
281 * @param status the status of the stream at the time this function is called; 275 * @param status the status of the stream at the time this function is called;
282 * GNUNET_OK if writing to stream was completed successfully, 276 * GNUNET_STREAM_OK if writing to stream was completed successfully;
277 * GNUNET_STREAM_TIMEOUT if the given data is not sent successfully
278 * (this doesn't mean that the data is never sent, the receiver may
279 * have read the data but its ACKs may have been lost);
283 * GNUNET_STREAM_SHUTDOWN if the stream is shutdown for writing in the 280 * GNUNET_STREAM_SHUTDOWN if the stream is shutdown for writing in the
284 * mean time. 281 * mean time; GNUNET_STREAM_SYSERR if the stream is broken and cannot
282 * be processed.
285 * @param size the number of bytes written 283 * @param size the number of bytes written
286 */ 284 */
287typedef void (*GNUNET_STREAM_CompletionContinuation) (void *cls, 285typedef void (*GNUNET_STREAM_CompletionContinuation) (void *cls,
@@ -315,9 +313,10 @@ struct GNUNET_STREAM_IOReadHandle;
315 * stream 313 * stream
316 * @param write_cont_cls the closure 314 * @param write_cont_cls the closure
317 * 315 *
318 * @return handle to cancel the operation; if a previous write is pending or 316 * @return handle to cancel the operation; if a previous write is pending NULL
319 * the stream has been shutdown for this operation then write_cont is 317 * is returned. If the stream has been shutdown for this operation or
320 * immediately called and NULL is returned. 318 * is broken then write_cont is immediately called and NULL is
319 * returned.
321 */ 320 */
322struct GNUNET_STREAM_IOWriteHandle * 321struct GNUNET_STREAM_IOWriteHandle *
323GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket, 322GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket,