aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_server_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-22 07:22:50 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-22 07:22:50 +0000
commit09082d4872f060aedf1364fb5ebc1584ee4c47d6 (patch)
tree005d7dc42a1c38d6c79a522d6384035e18db4c93 /src/include/gnunet_server_lib.h
parentc7f9e2399e5d703f0137ebb0038173c56894b8e2 (diff)
downloadgnunet-09082d4872f060aedf1364fb5ebc1584ee4c47d6.tar.gz
gnunet-09082d4872f060aedf1364fb5ebc1584ee4c47d6.zip
refine API to make it usable for server itself
Diffstat (limited to 'src/include/gnunet_server_lib.h')
-rw-r--r--src/include/gnunet_server_lib.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index 7af133b89..070d254ad 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -657,14 +657,36 @@ GNUNET_SERVER_mst_create (size_t maxbuf,
657 * @param size number of bytes in buf 657 * @param size number of bytes in buf
658 * @param purge should any excess bytes in the buffer be discarded 658 * @param purge should any excess bytes in the buffer be discarded
659 * (i.e. for packet-based services like UDP) 659 * (i.e. for packet-based services like UDP)
660 * @return GNUNET_NO if the data stream is corrupt 660 * @param one_shot only call callback once, keep rest of message in buffer
661 * GNUNET_SYSERR if the data stream is corrupt beyond repair 661 * @return GNUNET_OK if we are done processing (need more data)
662 * GNUNET_NO if one_shot was set and we have another message ready
663 * GNUNET_SYSERR if the data stream is corrupt
662 */ 664 */
663int 665int
664GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, 666GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
665 const char *buf, 667 const char *buf,
666 size_t size, 668 size_t size,
667 int purge); 669 int purge,
670 int one_shot);
671
672
673/**
674 * Read incoming data into the receive buffer and call the
675 * callback for all complete messages.
676 *
677 * @param mst tokenizer to use
678 * @param sock socket to read from (must be ready according to select)
679 * @param purge should any excess bytes in the buffer be discarded
680 * (i.e. for packet-based services like UDP)
681 * @return GNUNET_NO if the data stream is corrupt
682 * GNUNET_SYSERR if the data stream is corrupt beyond repair
683 */
684int
685GNUNET_SERVER_mst_read (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
686 const char *buf,
687 size_t size,
688 int purge);
689
668 690
669/** 691/**
670 * Destroys a tokenizer. 692 * Destroys a tokenizer.