summaryrefslogtreecommitdiff
path: root/src/openvpn/lzo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvpn/lzo.c')
-rw-r--r--src/openvpn/lzo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/openvpn/lzo.c b/src/openvpn/lzo.c
index 8d9efea..0188814 100644
--- a/src/openvpn/lzo.c
+++ b/src/openvpn/lzo.c
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
+ * Copyright (C) 2002-2021 OpenVPN Inc <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -103,9 +103,11 @@ lzo_compress_init(struct compress_context *compctx)
msg(D_INIT_MEDIUM, "LZO compression initializing");
ASSERT(!(compctx->flags & COMP_F_SWAP));
compctx->wu.lzo.wmem_size = LZO_WORKSPACE;
- if (lzo_init() != LZO_E_OK)
+
+ int lzo_status = lzo_init();
+ if (lzo_status != LZO_E_OK)
{
- msg(M_FATAL, "Cannot initialize LZO compression library");
+ msg(M_FATAL, "Cannot initialize LZO compression library (lzo_init() returns %d)", lzo_status);
}
compctx->wu.lzo.wmem = (lzo_voidp) lzo_malloc(compctx->wu.lzo.wmem_size);
check_malloc_return(compctx->wu.lzo.wmem);
@@ -121,7 +123,7 @@ lzo_compress_uninit(struct compress_context *compctx)
static inline bool
lzo_compression_enabled(struct compress_context *compctx)
{
- if (compctx->flags & COMP_F_ASYM)
+ if (!(compctx->flags & COMP_F_ALLOW_COMPRESS))
{
return false;
}