diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-21 21:42:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-21 21:42:07 +0000 |
commit | c7f9e2399e5d703f0137ebb0038173c56894b8e2 (patch) | |
tree | 805e29ae09749d4e95920ccda080413a4cea265f /src/include/gnunet_server_lib.h | |
parent | 46cfd0e998c3946f75b7dd7376fc7587a6f4b562 (diff) | |
download | gnunet-c7f9e2399e5d703f0137ebb0038173c56894b8e2.tar.gz gnunet-c7f9e2399e5d703f0137ebb0038173c56894b8e2.zip |
yay spagetti
Diffstat (limited to 'src/include/gnunet_server_lib.h')
-rw-r--r-- | src/include/gnunet_server_lib.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index ababbeea9..7af133b89 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h | |||
@@ -637,19 +637,30 @@ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, | |||
637 | * GNUNET_SERVER_MAX_MESSAGE_SIZE) | 637 | * GNUNET_SERVER_MAX_MESSAGE_SIZE) |
638 | * @param client_identity ID of client for which this is a buffer, | 638 | * @param client_identity ID of client for which this is a buffer, |
639 | * can be NULL (will be passed back to 'cb') | 639 | * can be NULL (will be passed back to 'cb') |
640 | * @param cb function to call on completed messages | ||
641 | * @param cb_cls closure for cb | ||
640 | * @return handle to tokenizer | 642 | * @return handle to tokenizer |
641 | */ | 643 | */ |
642 | struct GNUNET_SERVER_MessageStreamTokenizer * | 644 | struct GNUNET_SERVER_MessageStreamTokenizer * |
643 | GNUNET_SERVER_mst_create (size_t maxbuf, | 645 | GNUNET_SERVER_mst_create (size_t maxbuf, |
644 | void *client_identity, | 646 | void *client_identity, |
645 | GNUNET_SERVER_MessageTokenizerCallback cb, | 647 | GNUNET_SERVER_MessageTokenizerCallback cb, |
646 | void *cls); | 648 | void *cb_cls); |
647 | 649 | ||
648 | 650 | ||
649 | /** | 651 | /** |
652 | * Add incoming data to the receive buffer and call the | ||
653 | * callback for all complete messages. | ||
650 | * | 654 | * |
655 | * @param mst tokenizer to use | ||
656 | * @param buf input data to add | ||
657 | * @param size number of bytes in buf | ||
658 | * @param purge should any excess bytes in the buffer be discarded | ||
659 | * (i.e. for packet-based services like UDP) | ||
660 | * @return GNUNET_NO if the data stream is corrupt | ||
661 | * GNUNET_SYSERR if the data stream is corrupt beyond repair | ||
651 | */ | 662 | */ |
652 | void | 663 | int |
653 | GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, | 664 | GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, |
654 | const char *buf, | 665 | const char *buf, |
655 | size_t size, | 666 | size_t size, |