diff --git a/Makefile b/Makefile index 62583726a..90088c08c 100644 --- a/Makefile +++ b/Makefile @@ -271,9 +271,9 @@ ifeq ($(STATIC),1) # For MacOS, Jacob Rapoport changed this to: # -L/usr/local/lib -lsqlite3 -lz -Wl,-lm -lpthread -ldl $(COVFLAGS) # But that doesn't static link. -LDLIBS = -L$(CPATH) -Wl,-dn $(SQLITE3_LDLIBS) -lz -Wl,-dy -lm -lpthread -ldl $(COVFLAGS) +LDLIBS = -L$(CPATH) -Wl,-dn $(SQLITE3_LDLIBS) -Wl,-dy -lm -lpthread -ldl $(COVFLAGS) else -LDLIBS = -L$(CPATH) -lm $(SQLITE3_LDLIBS) -lz $(COVFLAGS) +LDLIBS = -L$(CPATH) -lm $(SQLITE3_LDLIBS) $(COVFLAGS) endif # If we have the postgres client library we need to link against it as well diff --git a/common/decode_array.c b/common/decode_array.c index 86119d4e5..0f9a8310b 100644 --- a/common/decode_array.c +++ b/common/decode_array.c @@ -2,25 +2,6 @@ #include #include #include -#include - -static u8 *unzlib(const tal_t *ctx, const u8 *encoded, size_t len) -{ - /* http://www.zlib.net/zlib_tech.html gives 1032:1 as worst-case, - * which is 67632120 bytes for us. But they're not encoding zeroes, - * and each scid must be unique. So 1MB is far more reasonable. */ - unsigned long unclen = 1024*1024; - int zerr; - u8 *unc = tal_arr(ctx, u8, unclen); - - zerr = uncompress(unc, &unclen, encoded, len); - if (zerr != Z_OK) - return tal_free(unc); - - /* Truncate and return. */ - tal_resize(&unc, unclen); - return unc; -} struct short_channel_id *decode_short_ids(const tal_t *ctx, const u8 *encoded) { @@ -43,11 +24,7 @@ struct short_channel_id *decode_short_ids(const tal_t *ctx, const u8 *encoded) type = fromwire_u8(&encoded, &max); switch (type) { case ARR_ZLIB_DEPRECATED: - encoded = unzlib(tmpctx, encoded, max); - if (!encoded) - return NULL; - max = tal_count(encoded); - /* fall thru */ + return NULL; case ARR_UNCOMPRESSED: scids = tal_arr(ctx, struct short_channel_id, 0); while (max) { @@ -86,11 +63,7 @@ bigsize_t *decode_scid_query_flags(const tal_t *ctx, */ switch (qf->encoding_type) { case ARR_ZLIB_DEPRECATED: - encoded = unzlib(tmpctx, encoded, max); - if (!encoded) - return NULL; - max = tal_count(encoded); - /* fall thru */ + return NULL; case ARR_UNCOMPRESSED: flags = tal_arr(ctx, bigsize_t, 0); while (max) @@ -120,11 +93,7 @@ decode_channel_update_timestamps(const tal_t *ctx, * query_short_channel_ids_tlvs! */ switch (timestamps_tlv->encoding_type) { case ARR_ZLIB_DEPRECATED: - encoded = unzlib(tmpctx, encoded, max); - if (!encoded) - return NULL; - max = tal_count(encoded); - /* fall thru */ + return NULL; case ARR_UNCOMPRESSED: ts = tal_arr(ctx, struct channel_update_timestamps, 0); while (max) { diff --git a/devtools/mkencoded.c b/devtools/mkencoded.c index 368b66993..6ff556be9 100644 --- a/devtools/mkencoded.c +++ b/devtools/mkencoded.c @@ -5,7 +5,6 @@ #include #include #include -#include static NORETURN void usage(void) { @@ -43,20 +42,7 @@ int main(int argc, char *argv[]) if (encoding == ARR_UNCOMPRESSED) printf("%02x%s\n", encoding, tal_hex(NULL, data)); else if (encoding == ARR_ZLIB_DEPRECATED) { - /* https://www.zlib.net/zlib_tech.html: - * the only expansion is an overhead of five bytes per 16 KB - * block (about 0.03%), plus a one-time overhead of six bytes - * for the entire stream. - */ - unsigned long compressed_len = tal_bytelen(data) - + 6 + 5*(tal_bytelen(data) + 16384)/16384; - u8 *z = tal_arr(NULL, u8, compressed_len); - if (compress2(z, &compressed_len, data, tal_bytelen(data), - Z_DEFAULT_COMPRESSION) != Z_OK) - errx(1, "Error compressing stream?"); - - printf("%02x%s\n", encoding, - tal_hexstr(NULL, z, compressed_len)); + errx(1, "ZLIB compression deprecated"); } else { errx(1, "Unknown encoding %u", encoding); } diff --git a/gossipd/queries.c b/gossipd/queries.c index a282abddf..200a6f82e 100644 --- a/gossipd/queries.c +++ b/gossipd/queries.c @@ -14,7 +14,6 @@ #include #include #include -#include static u32 dev_max_encoding_bytes = -1U; diff --git a/tools/headerversions.c b/tools/headerversions.c index 00435e867..d2a0f85db 100644 --- a/tools/headerversions.c +++ b/tools/headerversions.c @@ -14,15 +14,12 @@ # define IF_SQLITE3(...) #endif #include -#include static const char template[] = "/* Generated file by tools/headerversions, do not edit! */\n" IF_SQLITE3("/* SQLITE3 version: %u */\n") - "/* ZLIB version: %s */\n" "#include \n" IF_SQLITE3("#include \n") - "#include \n" "\n" "static inline void check_linked_library_versions(void)\n" "{\n" @@ -36,10 +33,6 @@ static const char template[] = " errx(1, \"SQLITE major version mismatch: compiled %%u, now %%u\",\n" " SQLITE_VERSION_NUMBER, sqlite3_libversion_number());\n" ) - " /* zlib documents that first char alters ABI. Kudos! */\n" - " if (zlibVersion()[0] != ZLIB_VERSION[0])\n" - " errx(1, \"zlib version mismatch: compiled %%s, now %%s\",\n" - " ZLIB_VERSION, zlibVersion());\n" "}\n"; int main(int argc, char *argv[]) @@ -57,8 +50,7 @@ int main(int argc, char *argv[]) err(1, "Reading %s", argv[1]); new = tal_fmt(NULL, template, - IF_SQLITE3(sqlite3_libversion_number(),) - zlibVersion()); + IF_SQLITE3(sqlite3_libversion_number())); if (!file || !streq(new, file)) { int fd = open(argv[1], O_TRUNC|O_WRONLY|O_CREAT, 0666); if (fd < 0)