commit 5c3021be8536e2b41d1ecff88e201333a51216b7 Author: Mike Perry mikeperry-git@torproject.org Date: Tue Jul 20 18:30:23 2021 +0000
Make inbuf and outbuf len check params const --- src/core/mainloop/connection.c | 4 ++-- 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);