diff options
author | Gert Doering <gert@greenie.muc.de> | 2014-01-01 22:57:58 +0100 |
---|---|---|
committer | Gert Doering <gert@greenie.muc.de> | 2014-01-06 12:18:53 +0100 |
commit | 40efb6359aff0e4805c0439acd6e899c687ef058 (patch) | |
tree | ff119c7a017fa18f939f76e0f2577ef9a94f8d1d /src/openvpn/init.c | |
parent | 56ab21091c0f1e07d0a6ef7815160f6ae072498d (diff) | |
download | openvpn-40efb6359aff0e4805c0439acd6e899c687ef058.tar.gz openvpn-40efb6359aff0e4805c0439acd6e899c687ef058.tar.xz openvpn-40efb6359aff0e4805c0439acd6e899c687ef058.zip |
Implement LZ4 compression.
Implement LZ4 compression, similar to the existing snappy / push-peer-info
model: a LZ4 capable client will send IV_LZ4=1 to the server, and the
algorithm is selected by pushing "compress lz4" back.
LZ4 does not compress as well as LZO or Snappy, but needs far less CPU
and is much faster, thus better suited for mobile devices. See
https://code.google.com/p/lz4/ for more details.
LZ4 include and library path can be specified by specifying LZ4_LIBS=...
and LZ4_CFLAGS=... on the configure command line.
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1388613479-22377-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8153
Diffstat (limited to 'src/openvpn/init.c')
-rw-r--r-- | src/openvpn/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 1b8ee22..d324166 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -2379,7 +2379,7 @@ do_init_frame (struct context *c) { comp_add_to_extra_frame (&c->c2.frame); -#if !defined(ENABLE_SNAPPY) +#if !defined(ENABLE_SNAPPY) && !defined(ENABLE_LZ4) /* * Compression usage affects buffer alignment when non-swapped algs * such as LZO is used. @@ -2394,7 +2394,7 @@ do_init_frame (struct context *c) * dispatch if packet is uncompressed) at the cost of requiring * decryption output to be written to an unaligned buffer, so * it's more of a tradeoff than an optimal solution and we don't - * include it when we are doing a modern build with Snappy. + * include it when we are doing a modern build with Snappy or LZ4. * Strictly speaking, on the server it would be better to execute * this code for every connection after we decide the compression * method, but currently the frame code doesn't appear to be |