aboutsummaryrefslogtreecommitdiff
path: root/src/or/proto_http.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-08 11:54:44 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-05 13:57:51 -0400
commitcddac959e7fb5729956a5250351e0fa1289d719f (patch)
tree1b00d23198966670ff7b1c3a25a4b2538ef7c350 /src/or/proto_http.c
parent234c5015f1536bc51fe5f87c5b7c1072d3f9dbd2 (diff)
downloadtor-cddac959e7fb5729956a5250351e0fa1289d719f.tar.gz
tor-cddac959e7fb5729956a5250351e0fa1289d719f.zip
Replace buf->datalen usage in proto_*.c with buf_datalen() call.
This lets us remove BUFFERS_PRIVATE from two of the modules.
Diffstat (limited to 'src/or/proto_http.c')
-rw-r--r--src/or/proto_http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/proto_http.c b/src/or/proto_http.c
index 2ba3f93ab6..a47644a30a 100644
--- a/src/or/proto_http.c
+++ b/src/or/proto_http.c
@@ -58,7 +58,7 @@ fetch_from_buf_http(buf_t *buf,
crlf_offset = buf_find_string_offset(buf, "\r\n\r\n", 4);
if (crlf_offset > (int)max_headerlen ||
- (crlf_offset < 0 && buf->datalen > max_headerlen)) {
+ (crlf_offset < 0 && buf_datalen(buf) > max_headerlen)) {
log_debug(LD_HTTP,"headers too long.");
return -1;
} else if (crlf_offset < 0) {
@@ -72,7 +72,7 @@ fetch_from_buf_http(buf_t *buf,
headerlen = crlf_offset + 4;
headers = buf->head->data;
- bodylen = buf->datalen - headerlen;
+ bodylen = buf_datalen(buf) - headerlen;
log_debug(LD_HTTP,"headerlen %d, bodylen %d.", (int)headerlen, (int)bodylen);
if (max_headerlen <= headerlen) {