aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2012-03-23 22:05:48 -0700
committerNick Mathewson <nickm@torproject.org>2013-07-18 14:59:55 -0400
commitba30d635c5efbbb6a9455925720196b9d56163f6 (patch)
treea4cc63713b97c3d7227222af350988ea9ed0a6cb /src/or/buffers.c
parent8bf0382b220b31605fb5a542f36a842bdd7a6ed0 (diff)
downloadtor-ba30d635c5efbbb6a9455925720196b9d56163f6.tar
tor-ba30d635c5efbbb6a9455925720196b9d56163f6.tar.gz
Document code and change the Extended ORPort command numbers.
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r--src/or/buffers.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index a79d17bbe..ead6baa88 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1702,9 +1702,15 @@ fetch_from_evbuffer_socks(struct evbuffer *buf, socks_request_t *req,
}
#endif
-/*DOCDOC*/
+/** The size of the header of an Extended ORPort message: 2 bytes for
+ * COMMAND, 2 bytes for BODYLEN */
#define EXT_OR_CMD_HEADER_SIZE 4
-/*DOCDOC*/
+
+/** Read <b>buf</b>, which should contain an Extended ORPort message
+ * from a transport proxy. If well-formed, create and populate
+ * <b>out</b> with the Extended ORport message. Return 0 if the
+ * buffer was incomplete, 1 if it was well-formed and -1 if we
+ * encountered an error while parsing it. */
int
fetch_ext_or_command_from_buf(buf_t *buf, ext_or_cmd_t **out)
{
@@ -1727,7 +1733,11 @@ fetch_ext_or_command_from_buf(buf_t *buf, ext_or_cmd_t **out)
}
#ifdef USE_BUFFEREVENTS
-/*DOCDOC*/
+/** Read <b>buf</b>, which should contain an Extended ORPort message
+ * from a transport proxy. If well-formed, create and populate
+ * <b>out</b> with the Extended ORport message. Return 0 if the
+ * buffer was incomplete, 1 if it was well-formed and -1 if we
+ * encountered an error while parsing it. */
int
fetch_ext_or_command_from_evbuffer(struct evbuffer *buf, ext_or_cmd_t **out)
{