aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-08-13 23:38:30 +0000
committerRoger Dingledine <arma@torproject.org>2006-08-13 23:38:30 +0000
commit6fdc63aed29dd727524339e4c8a5537e9930149a (patch)
tree15e2d548e06f3022e1a87d0d7a14a0fdec0f29c5
parent6410baf624915e41a5b58e2c57becaa4bef966b6 (diff)
downloadtor-6fdc63aed29dd727524339e4c8a5537e9930149a.tar
tor-6fdc63aed29dd727524339e4c8a5537e9930149a.tar.gz
simplify the connection_write_to_buf_zlib() wrapper.
svn:r7042
-rw-r--r--src/or/connection.c5
-rw-r--r--src/or/dirserv.c10
-rw-r--r--src/or/or.h1
3 files changed, 6 insertions, 10 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index e760e257f..6fc68263b 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1696,7 +1696,6 @@ connection_write_to_buf(const char *string, size_t len, connection_t *conn)
void
connection_write_to_buf_zlib(dir_connection_t *dir_conn,
- tor_zlib_state_t *state,
const char *data, size_t data_len,
int done)
{
@@ -1713,8 +1712,8 @@ connection_write_to_buf_zlib(dir_connection_t *dir_conn,
old_datalen = buf_datalen(conn->outbuf);
/* XXXX TOO much duplicate code! XXXX012NM */
CONN_LOG_PROTECT(conn, r = write_to_buf_zlib(
- conn->outbuf, state, data, data_len,
- done));
+ conn->outbuf, dir_conn->zlib_state,
+ data, data_len, done));
if (r < 0) {
log_warn(LD_NET,
"write_to_buf failed. Closing connection (fd %d).", conn->s);
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index ea8a0b512..b2342be22 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1829,7 +1829,7 @@ static int
connection_dirserv_finish_spooling(dir_connection_t *conn)
{
if (conn->zlib_state) {
- connection_write_to_buf_zlib(conn, conn->zlib_state, "", 0, 1);
+ connection_write_to_buf_zlib(conn, "", 0, 1);
tor_zlib_free(conn->zlib_state);
conn->zlib_state = NULL;
}
@@ -1865,10 +1865,8 @@ connection_dirserv_add_servers_to_outbuf(dir_connection_t *conn)
body = signed_descriptor_get_body(sd);
if (conn->zlib_state) {
int last = ! smartlist_len(conn->fingerprint_stack);
- connection_write_to_buf_zlib(
- conn, conn->zlib_state,
- body, sd->signed_descriptor_len,
- last);
+ connection_write_to_buf_zlib(conn, body,
+ sd->signed_descriptor_len, last);
if (last) {
tor_zlib_free(conn->zlib_state);
conn->zlib_state = NULL;
@@ -1905,7 +1903,7 @@ connection_dirserv_add_dir_bytes_to_outbuf(dir_connection_t *conn)
bytes = remaining;
if (conn->zlib_state) {
- connection_write_to_buf_zlib(conn, conn->zlib_state,
+ connection_write_to_buf_zlib(conn,
conn->cached_dir->dir_z + conn->cached_dir_offset,
bytes, bytes == remaining);
} else {
diff --git a/src/or/or.h b/src/or/or.h
index fc2d3063a..b07cec267 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1836,7 +1836,6 @@ void _connection_controller_force_write(control_connection_t *conn);
void connection_write_to_buf(const char *string, size_t len,
connection_t *conn);
void connection_write_to_buf_zlib(dir_connection_t *conn,
- tor_zlib_state_t *state,
const char *data, size_t data_len,
int done);