diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2021-07-20 18:30:23 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-07-30 12:57:31 -0400 |
commit | 5c3021be8536e2b41d1ecff88e201333a51216b7 (patch) | |
tree | 79aafc8d5a529ecca06afcb692fb74ff0bbb6e88 /src | |
parent | a0368b375958bff39a706fbbd9862765013b4207 (diff) | |
download | tor-5c3021be8536e2b41d1ecff88e201333a51216b7.tar.gz tor-5c3021be8536e2b41d1ecff88e201333a51216b7.zip |
Make inbuf and outbuf len check params const
Diffstat (limited to 'src')
-rw-r--r-- | src/core/mainloop/connection.c | 4 | ||||
-rw-r--r-- | src/core/mainloop/connection.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 92755914ec..79e034fb34 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -250,13 +250,13 @@ CONST_TO_LISTENER_CONN(const connection_t *c) } size_t -connection_get_inbuf_len(connection_t *conn) +connection_get_inbuf_len(const connection_t *conn) { return conn->inbuf ? buf_datalen(conn->inbuf) : 0; } size_t -connection_get_outbuf_len(connection_t *conn) +connection_get_outbuf_len(const connection_t *conn) { return conn->outbuf ? buf_datalen(conn->outbuf) : 0; } diff --git a/src/core/mainloop/connection.h b/src/core/mainloop/connection.h index 36c94d6570..8b378b15a4 100644 --- a/src/core/mainloop/connection.h +++ b/src/core/mainloop/connection.h @@ -274,8 +274,8 @@ void connection_buf_add_compress(const char *string, size_t len, struct dir_connection_t *conn, int done); void connection_buf_add_buf(struct connection_t *conn, struct buf_t *buf); -size_t connection_get_inbuf_len(struct connection_t *conn); -size_t connection_get_outbuf_len(struct connection_t *conn); +size_t connection_get_inbuf_len(const struct connection_t *conn); +size_t connection_get_outbuf_len(const struct connection_t *conn); struct connection_t *connection_get_by_global_id(uint64_t id); struct connection_t *connection_get_by_type(int type); |