summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-08 15:16:39 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-05 13:57:51 -0400
commit4a7e90adc5828263a5d2dc3744818f2189c04bc7 (patch)
tree62cac4a9acefb41d9e3b9b6ee7d6501ee64efc01 /src/or/main.c
parent336aa21e37b6c5bd4f1215ceba27c21f6c43dce7 (diff)
downloadtor-4a7e90adc5828263a5d2dc3744818f2189c04bc7.tar.gz
tor-4a7e90adc5828263a5d2dc3744818f2189c04bc7.zip
Repair buffer API so everything starts with buf_.
Our convention is that functions which manipulate a type T should be named T_foo. But the buffer functions were super old, and followed all kinds of conventions. Now they're uniform. Here's the perl I used to do this: \#!/usr/bin/perl -w -i -p s/read_to_buf\(/buf_read_from_socket\(/; s/flush_buf\(/buf_flush_to_socket\(/; s/read_to_buf_tls\(/buf_read_from_tls\(/; s/flush_buf_tls\(/buf_flush_to_tls\(/; s/write_to_buf\(/buf_add\(/; s/write_to_buf_compress\(/buf_add_compress\(/; s/move_buf_to_buf\(/buf_move_to_buf\(/; s/peek_from_buf\(/buf_peek\(/; s/fetch_from_buf\(/buf_get_bytes\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/buf_remove_from_front\(/buf_drain\(/; s/peek_buf_startswith\(/buf_peek_startswith\(/; s/assert_buf_ok\(/buf_assert_ok\(/;
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/main.c b/src/or/main.c
index a9d4bdb6ee..9dc84f7deb 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -836,7 +836,7 @@ conn_close_if_marked(int i)
(int)conn->outbuf_flushlen,
conn->marked_for_close_file, conn->marked_for_close);
if (conn->linked_conn) {
- retval = move_buf_to_buf(conn->linked_conn->inbuf, conn->outbuf,
+ retval = buf_move_to_buf(conn->linked_conn->inbuf, conn->outbuf,
&conn->outbuf_flushlen);
if (retval >= 0) {
/* The linked conn will notice that it has data when it notices that
@@ -850,12 +850,12 @@ conn_close_if_marked(int i)
connection_wants_to_flush(conn));
} else if (connection_speaks_cells(conn)) {
if (conn->state == OR_CONN_STATE_OPEN) {
- retval = flush_buf_tls(TO_OR_CONN(conn)->tls, conn->outbuf, sz,
+ retval = buf_flush_to_tls(TO_OR_CONN(conn)->tls, conn->outbuf, sz,
&conn->outbuf_flushlen);
} else
retval = -1; /* never flush non-open broken tls connections */
} else {
- retval = flush_buf(conn->s, conn->outbuf, sz, &conn->outbuf_flushlen);
+ retval = buf_flush_to_socket(conn->s, conn->outbuf, sz, &conn->outbuf_flushlen);
}
if (retval >= 0 && /* Technically, we could survive things like
TLS_WANT_WRITE here. But don't bother for now. */