gossipd: drop zlib support.

This was removed from the spec on Apr 25, 2022.  We stopped ever sending them
in 0.12.0 (2022-08-23).  Now we remove receive support.

Changelog-Protocol: Removed support for zlib-compressed short-channel-ids in query responses.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2024-07-09 22:44:29 +09:30
parent d60977f37f
commit 531845971c
5 changed files with 7 additions and 61 deletions

View File

@@ -5,7 +5,6 @@
#include <ccan/str/hex/hex.h>
#include <common/decode_array.h>
#include <stdio.h>
#include <zlib.h>
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);
}