aboutsummaryrefslogtreecommitdiff
path: root/src/common/torgzip.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-02-13 08:01:59 +0000
committerRoger Dingledine <arma@torproject.org>2006-02-13 08:01:59 +0000
commit6ce36ead4284cdd973fdc4e310a2052fd9d46658 (patch)
tree58a8571bafd422da915b4db38770aadf3bf35073 /src/common/torgzip.c
parentccd68275c4b41b15166f8a69c7ae5ff769e5ffcd (diff)
downloadtor-6ce36ead4284cdd973fdc4e310a2052fd9d46658.tar
tor-6ce36ead4284cdd973fdc4e310a2052fd9d46658.tar.gz
Start the process of converting warn to log_warn and so on.
This is needed because Windows already has an err() that we can't clobber. And we need to be able to make the log functions a macro so we can print the function's name in the log entry. svn:r6000
Diffstat (limited to 'src/common/torgzip.c')
-rw-r--r--src/common/torgzip.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index a524deba3..e2fa98ec7 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -76,7 +76,7 @@ tor_gzip_compress(char **out, size_t *out_len,
if (method == GZIP_METHOD && !is_gzip_supported()) {
/* Old zlib version don't support gzip in deflateInit2 */
- warn(LD_GENERAL, "Gzip not supported with zlib %s", ZLIB_VERSION);
+ log_warn(LD_GENERAL, "Gzip not supported with zlib %s", ZLIB_VERSION);
return -1;
}
@@ -92,8 +92,8 @@ tor_gzip_compress(char **out, size_t *out_len,
if (deflateInit2(stream, Z_BEST_COMPRESSION, Z_DEFLATED,
method_bits(method),
8, Z_DEFAULT_STRATEGY) != Z_OK) {
- warn(LD_GENERAL, "Error from deflateInit2: %s",
- stream->msg?stream->msg:"<no message>");
+ log_warn(LD_GENERAL, "Error from deflateInit2: %s",
+ stream->msg?stream->msg:"<no message>");
goto err;
}
@@ -121,15 +121,15 @@ tor_gzip_compress(char **out, size_t *out_len,
stream->avail_out = out_size - offset;
break;
default:
- warn(LD_GENERAL, "Gzip compression didn't finish: %s",
- stream->msg ? stream->msg : "<no message>");
+ log_warn(LD_GENERAL, "Gzip compression didn't finish: %s",
+ stream->msg ? stream->msg : "<no message>");
goto err;
}
}
done:
*out_len = stream->total_out;
if (deflateEnd(stream)!=Z_OK) {
- warn(LD_GENERAL, "Error freeing gzip structures");
+ log_warn(LD_GENERAL, "Error freeing gzip structures");
goto err;
}
tor_free(stream);
@@ -171,7 +171,7 @@ tor_gzip_uncompress(char **out, size_t *out_len,
if (method == GZIP_METHOD && !is_gzip_supported()) {
/* Old zlib version don't support gzip in inflateInit2 */
- warn(LD_GENERAL, "Gzip not supported with zlib %s", ZLIB_VERSION);
+ log_warn(LD_GENERAL, "Gzip not supported with zlib %s", ZLIB_VERSION);
return -1;
}
@@ -186,8 +186,8 @@ tor_gzip_uncompress(char **out, size_t *out_len,
if (inflateInit2(stream,
method_bits(method)) != Z_OK) {
- warn(LD_GENERAL, "Error from inflateInit2: %s",
- stream->msg?stream->msg:"<no message>");
+ log_warn(LD_GENERAL, "Error from inflateInit2: %s",
+ stream->msg?stream->msg:"<no message>");
goto err;
}
@@ -206,8 +206,8 @@ tor_gzip_uncompress(char **out, size_t *out_len,
goto done;
/* There may be more compressed data here. */
if (inflateInit2(stream, method_bits(method)) != Z_OK) {
- warn(LD_GENERAL, "Error from inflateInit2: %s",
- stream->msg?stream->msg:"<no message>");
+ log_warn(LD_GENERAL, "Error from inflateInit2: %s",
+ stream->msg?stream->msg:"<no message>");
goto err;
}
break;
@@ -230,8 +230,8 @@ tor_gzip_uncompress(char **out, size_t *out_len,
stream->avail_out = out_size - offset;
break;
default:
- warn(LD_GENERAL, "Gzip decompression returned an error: %s",
- stream->msg ? stream->msg : "<no message>");
+ log_warn(LD_GENERAL, "Gzip decompression returned an error: %s",
+ stream->msg ? stream->msg : "<no message>");
goto err;
}
}
@@ -240,7 +240,7 @@ tor_gzip_uncompress(char **out, size_t *out_len,
r = inflateEnd(stream);
tor_free(stream);
if (r != Z_OK) {
- warn(LD_GENERAL, "Error freeing gzip structures");
+ log_warn(LD_GENERAL, "Error freeing gzip structures");
goto err;
}