diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-08 11:54:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-05 13:57:51 -0400 |
commit | cddac959e7fb5729956a5250351e0fa1289d719f (patch) | |
tree | 1b00d23198966670ff7b1c3a25a4b2538ef7c350 /src/or/proto_cell.c | |
parent | 234c5015f1536bc51fe5f87c5b7c1072d3f9dbd2 (diff) | |
download | tor-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_cell.c')
-rw-r--r-- | src/or/proto_cell.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/proto_cell.c b/src/or/proto_cell.c index 9e5cdff423..4c86b7e4d0 100644 --- a/src/or/proto_cell.c +++ b/src/or/proto_cell.c @@ -4,7 +4,6 @@ * Copyright (c) 2007-2017, The Tor Project, Inc. */ /* See LICENSE for licensing information */ -#define BUFFERS_PRIVATE // XXXX remove. #include "or.h" #include "buffers.h" #include "proto_cell.h" @@ -56,7 +55,7 @@ fetch_var_cell_from_buf(buf_t *buf, var_cell_t **out, int linkproto) const int circ_id_len = get_circ_id_size(wide_circ_ids); const unsigned header_len = get_var_cell_header_size(wide_circ_ids); *out = NULL; - if (buf->datalen < header_len) + if (buf_datalen(buf) < header_len) return 0; peek_from_buf(hdr, header_len, buf); @@ -65,7 +64,7 @@ fetch_var_cell_from_buf(buf_t *buf, var_cell_t **out, int linkproto) return 0; length = ntohs(get_uint16(hdr + circ_id_len + 1)); - if (buf->datalen < (size_t)(header_len+length)) + if (buf_datalen(buf) < (size_t)(header_len+length)) return 1; result = var_cell_new(length); result->command = command; |