since libz's been required in rpcimpl.c for ages and nobody's complained, remove the HAVE_ZLIB cruft for conditional-compiling with and without zlib.

This commit is contained in:
Jordan Lee
2014-07-13 21:50:56 +00:00
parent c1beabfea6
commit 2e3ffdc6ec
2 changed files with 2 additions and 14 deletions

View File

@@ -13,9 +13,7 @@
#include <unistd.h> /* close */ #include <unistd.h> /* close */
#ifdef HAVE_ZLIB #include <zlib.h>
#include <zlib.h>
#endif
#include <event2/buffer.h> #include <event2/buffer.h>
#include <event2/event.h> #include <event2/event.h>
@@ -67,10 +65,8 @@ struct tr_rpc_server
char * sessionId; char * sessionId;
time_t sessionIdExpiresAt; time_t sessionIdExpiresAt;
#ifdef HAVE_ZLIB
bool isStreamInitialized; bool isStreamInitialized;
z_stream stream; z_stream stream;
#endif
}; };
#define dbgmsg(...) \ #define dbgmsg(...) \
@@ -331,9 +327,6 @@ add_response (struct evhttp_request * req,
struct evbuffer * out, struct evbuffer * out,
struct evbuffer * content) struct evbuffer * content)
{ {
#ifndef HAVE_ZLIB
evbuffer_add_buffer (out, content);
#else
const char * key = "Accept-Encoding"; const char * key = "Accept-Encoding";
const char * encoding = evhttp_find_header (req->input_headers, key); const char * encoding = evhttp_find_header (req->input_headers, key);
const int do_compress = encoding && strstr (encoding, "gzip"); const int do_compress = encoding && strstr (encoding, "gzip");
@@ -400,7 +393,6 @@ add_response (struct evhttp_request * req,
evbuffer_commit_space (out, iovec, 1); evbuffer_commit_space (out, iovec, 1);
deflateReset (&server->stream); deflateReset (&server->stream);
} }
#endif
} }
static void static void
@@ -923,10 +915,8 @@ closeServer (void * vserver)
stopServer (s); stopServer (s);
while ((tmp = tr_list_pop_front (&s->whitelist))) while ((tmp = tr_list_pop_front (&s->whitelist)))
tr_free (tmp); tr_free (tmp);
#ifdef HAVE_ZLIB
if (s->isStreamInitialized) if (s->isStreamInitialized)
deflateEnd (&s->stream); deflateEnd (&s->stream);
#endif
tr_free (s->url); tr_free (s->url);
tr_free (s->sessionId); tr_free (s->sessionId);
tr_free (s->whitelistStr); tr_free (s->whitelistStr);

View File

@@ -13,9 +13,7 @@
#include <stdlib.h> /* strtol */ #include <stdlib.h> /* strtol */
#include <string.h> /* strcmp */ #include <string.h> /* strcmp */
#ifdef HAVE_ZLIB #include <zlib.h>
#include <zlib.h>
#endif
#include <event2/buffer.h> #include <event2/buffer.h>