Skip to content

Commit 0a9c70d

Browse files
committed
Implement selective compression
Separate general-purpose compression stream and zpq stream
1 parent bf968f6 commit 0a9c70d

File tree

11 files changed

+1296
-627
lines changed

11 files changed

+1296
-627
lines changed

src/backend/libpq/pqcomm.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ pq_configure(Port *port)
245245
{
246246
int compression_level = ZPQ_DEFAULT_COMPRESSION_LEVEL;
247247
int impl = -1;
248-
char **server_compression_algorithms = zpq_get_supported_algorithms();
248+
char **server_compression_algorithms = zs_get_supported_algorithms();
249249
int index = -1;
250250
char *protocol_extension = strchr(client_compression_algorithms, ';');
251251

@@ -289,7 +289,8 @@ pq_configure(Port *port)
289289

290290
if (index >= 0) /* Use compression */
291291
{
292-
PqStream = zpq_create(impl, compression_level, impl, write_compressed, read_compressed, MyProcPort, NULL, 0);
292+
PqStream = zpq_create(impl, compression_level, impl, write_compressed, read_compressed, MyProcPort,
293+
NULL, 0);
293294
if (!PqStream)
294295
{
295296
ereport(LOG,
@@ -1080,7 +1081,7 @@ pq_recvbuf(bool nowait)
10801081

10811082
if (r < 0)
10821083
{
1083-
if (r == ZPQ_DECOMPRESS_ERROR)
1084+
if (r == ZS_DECOMPRESS_ERROR)
10841085
{
10851086
char const *msg = zpq_decompress_error(PqStream);
10861087

src/common/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ OBJS_COMMON = \
7878
username.o \
7979
wait_error.o \
8080
wchar.o \
81+
z_stream.o \
8182
zpq_stream.o
8283

8384
ifeq ($(with_openssl),yes)

0 commit comments

Comments
 (0)