From 537073fd55b3e35720e759c5c13e9da128a2b0bb Mon Sep 17 00:00:00 2001 From: james Date: Sun, 2 Oct 2005 03:41:35 +0000 Subject: version 2.1_beta1 git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@588 e7ae566f-a301-0410-adde-c780ea21d3b5 --- options.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index 77867ca..f2a7af7 100644 --- a/options.c +++ b/options.c @@ -560,9 +560,6 @@ init_options (struct options *o) o->rcvbuf = 65536; o->sndbuf = 65536; #endif -#ifdef USE_LZO - o->comp_lzo_adaptive = true; -#endif #ifdef TARGET_LINUX o->tuntap_options.txqueuelen = 100; #endif @@ -1062,8 +1059,7 @@ show_settings (const struct options *o) SHOW_BOOL (fast_io); #ifdef USE_LZO - SHOW_BOOL (comp_lzo); - SHOW_BOOL (comp_lzo_adaptive); + SHOW_INT (lzo); #endif SHOW_STR (route_script); @@ -1833,7 +1829,7 @@ options_string (const struct options *o, } #ifdef USE_LZO - if (o->comp_lzo) + if (o->lzo & LZO_SELECTED) buf_printf (&out, ",comp-lzo"); #endif @@ -4318,12 +4314,28 @@ add_option (struct options *options, else if (streq (p[0], "comp-lzo")) { VERIFY_PERMISSION (OPT_P_COMP); - options->comp_lzo = true; + if (p[1]) + { + ++i; + if (streq (p[1], "yes")) + options->lzo = LZO_SELECTED|LZO_ON; + else if (streq (p[1], "no")) + options->lzo = LZO_SELECTED; + else if (streq (p[1], "adaptive")) + options->lzo = LZO_SELECTED|LZO_ON|LZO_ADAPTIVE; + else + { + msg (msglevel, "bad comp-lzo option: %s -- must be 'yes', 'no', or 'adaptive'", p[1]); + goto err; + } + } + else + options->lzo = LZO_SELECTED|LZO_ON|LZO_ADAPTIVE; } else if (streq (p[0], "comp-noadapt")) { VERIFY_PERMISSION (OPT_P_COMP); - options->comp_lzo_adaptive = false; + options->lzo &= ~LZO_ADAPTIVE; } #endif /* USE_LZO */ #ifdef USE_CRYPTO -- cgit v1.2.3