aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-07-31 17:03:35 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-27 12:29:42 -0400
commita0f4841e2bc448b6e91e11c0c9dc2c93e5cf0ce7 (patch)
treeecfd64608595816c195f4a77692c69590491eb74 /src/or/buffers.h
parent4836014168067dc4ded2285a04a69ea169bb95a9 (diff)
downloadtor-a0f4841e2bc448b6e91e11c0c9dc2c93e5cf0ce7.tar.gz
tor-a0f4841e2bc448b6e91e11c0c9dc2c93e5cf0ce7.zip
Refactor SOCKS parsing code to handle evbuffers.
Now all of the logic is in a parse_socks() function that gets data from a buf_t or evbuffer-specific wrapper.
Diffstat (limited to 'src/or/buffers.h')
-rw-r--r--src/or/buffers.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/buffers.h b/src/or/buffers.h
index f4174e91ac..d6ff79e93f 100644
--- a/src/or/buffers.h
+++ b/src/or/buffers.h
@@ -35,10 +35,6 @@ int write_to_buf(const char *string, size_t string_len, buf_t *buf);
int write_to_buf_zlib(buf_t *buf, tor_zlib_state_t *state,
const char *data, size_t data_len, int done);
int move_buf_to_buf(buf_t *buf_out, buf_t *buf_in, size_t *buf_flushlen);
-#ifdef USE_BUFFEREVENTS
-int fetch_var_cell_from_evbuffer(struct evbuffer *buf, var_cell_t **out,
- int linkproto);
-#endif
int fetch_from_buf(char *string, size_t string_len, buf_t *buf);
int fetch_var_cell_from_buf(buf_t *buf, var_cell_t **out, int linkproto);
int fetch_from_buf_http(buf_t *buf,
@@ -52,6 +48,13 @@ int fetch_from_buf_line(buf_t *buf, char *data_out, size_t *data_len);
int peek_buf_has_control0_command(buf_t *buf);
+#ifdef USE_BUFFEREVENTS
+int fetch_var_cell_from_evbuffer(struct evbuffer *buf, var_cell_t **out,
+ int linkproto);
+int fetch_from_evbuffer_socks(struct evbuffer *buf, socks_request_t *req,
+ int log_sockstype, int safe_socks);
+#endif
+
void assert_buf_ok(buf_t *buf);
#ifdef BUFFERS_PRIVATE