summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-04-17 14:29:10 +0200
committerAlexander Færøy <ahf@torproject.org>2017-04-17 14:29:10 +0200
commit44cb86adbe2e9b9fef7bf5fd64b52a8e44441be5 (patch)
tree2dd93776ce5e16f2f8df7b6e7bda8cf96e891b57 /src/or
parente8b025dfc30ef0008cb44feb56ab3c740d2bae9b (diff)
downloadtor-44cb86adbe2e9b9fef7bf5fd64b52a8e44441be5.tar.gz
tor-44cb86adbe2e9b9fef7bf5fd64b52a8e44441be5.zip
Rename `tor_gzip_{compress,uncompress}` to `tor_{compress,uncompress}`.
To allow us to use the API name `tor_compress` and `tor_uncompress` as the main entry-point for all compression/uncompression and not just gzip and zlib. See https://bugs.torproject.org/21663
Diffstat (limited to 'src/or')
-rw-r--r--src/or/directory.c8
-rw-r--r--src/or/dirserv.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index bbe071b558..e7a71dde15 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2096,15 +2096,15 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
}
/* Try declared compression first if we can. */
if (compression == GZIP_METHOD || compression == ZLIB_METHOD)
- tor_gzip_uncompress(&new_body, &new_len, body, body_len, compression,
- !allow_partial, LOG_PROTOCOL_WARN);
+ tor_uncompress(&new_body, &new_len, body, body_len, compression,
+ !allow_partial, LOG_PROTOCOL_WARN);
/* Okay, if that didn't work, and we think that it was compressed
* differently, try that. */
if (!new_body &&
(guessed == GZIP_METHOD || guessed == ZLIB_METHOD) &&
compression != guessed)
- tor_gzip_uncompress(&new_body, &new_len, body, body_len, guessed,
- !allow_partial, LOG_PROTOCOL_WARN);
+ tor_uncompress(&new_body, &new_len, body, body_len, guessed,
+ !allow_partial, LOG_PROTOCOL_WARN);
/* If we're pretty sure that we have a compressed directory, and
* we didn't manage to uncompress it, then warn and bail. */
if (!plausible && !new_body) {
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 70b0b22f25..87afd69aba 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1176,8 +1176,8 @@ new_cached_dir(char *s, time_t published)
d->dir = s;
d->dir_len = strlen(s);
d->published = published;
- if (tor_gzip_compress(&(d->dir_z), &(d->dir_z_len), d->dir, d->dir_len,
- ZLIB_METHOD)) {
+ if (tor_compress(&(d->dir_z), &(d->dir_z_len), d->dir, d->dir_len,
+ ZLIB_METHOD)) {
log_warn(LD_BUG, "Error compressing directory");
}
return d;