From c74a4ab515990701800755b88c097f8239cc3811 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 23 Aug 2009 11:39:34 -0400 Subject: Documentation for a few bufferevent functions. --- src/or/connection.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/or/connection.c') diff --git a/src/or/connection.c b/src/or/connection.c index b39763055c..43f6c47ad4 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -2633,6 +2633,9 @@ connection_read_to_buf(connection_t *conn, int *max_to_read, int *socket_error) #ifdef USE_BUFFEREVENTS /* XXXX These generic versions could be simplified by making them type-specific */ + +/** Callback: Invoked whenever bytes are added to or drained from an input + * evbuffer. Used to track the number of bytes read. */ static void evbuffer_inbuf_callback(struct evbuffer *buf, const struct evbuffer_cb_info *info, void *arg) @@ -2653,7 +2656,8 @@ evbuffer_inbuf_callback(struct evbuffer *buf, } } -/** DOCDOC */ +/** Callback: Invoked whenever bytes are added to or drained from an output + * evbuffer. Used to track the number of bytes written. */ static void evbuffer_outbuf_callback(struct evbuffer *buf, const struct evbuffer_cb_info *info, void *arg) @@ -2673,7 +2677,7 @@ evbuffer_outbuf_callback(struct evbuffer *buf, } } -/** DOCDOC */ +/** Callback: invoked whenever a bufferevent has read data. */ void connection_handle_read_cb(struct bufferevent *bufev, void *arg) { @@ -2684,7 +2688,7 @@ connection_handle_read_cb(struct bufferevent *bufev, void *arg) connection_mark_for_close(conn); } -/** DOCDOC */ +/** Callback: invoked whenever a bufferevent has written data. */ void connection_handle_write_cb(struct bufferevent *bufev, void *arg) { @@ -2708,7 +2712,8 @@ connection_handle_write_cb(struct bufferevent *bufev, void *arg) } } -/** DOCDOC */ +/** Callback: invoked whenever a bufferevent has had an event (like a + * connection, or an eof, or an error) occur. */ void connection_handle_event_cb(struct bufferevent *bufev, short event, void *arg) { @@ -2746,6 +2751,7 @@ connection_handle_event_cb(struct bufferevent *bufev, short event, void *arg) } } +/** Set up the generic callbacks for the bufferevent on conn. */ void connection_configure_bufferevent_callbacks(connection_t *conn) { -- cgit v1.2.3-54-g00ecf