summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-02 03:41:35 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-02 03:41:35 +0000
commit537073fd55b3e35720e759c5c13e9da128a2b0bb (patch)
treef4d544e3e85bc2a32b33f6400ff74ec8d3826302 /init.c
parentc70caa7fd4a631f42b136bdcf3c5199774ed09e5 (diff)
downloadopenvpn-537073fd55b3e35720e759c5c13e9da128a2b0bb.tar.gz
openvpn-537073fd55b3e35720e759c5c13e9da128a2b0bb.tar.xz
openvpn-537073fd55b3e35720e759c5c13e9da128a2b0bb.zip
version 2.1_beta1
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@588 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r--init.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/init.c b/init.c
index d0767f1..f537668 100644
--- a/init.c
+++ b/init.c
@@ -956,6 +956,7 @@ pull_permission_mask (const struct context *c)
| OPT_P_SETENV
| OPT_P_SHAPER
| OPT_P_TIMER
+ | OPT_P_COMP
| OPT_P_PERSIST
| OPT_P_MESSAGES
| OPT_P_EXPLICIT_NOTIFY
@@ -998,6 +999,17 @@ do_deferred_options (struct context *c, const unsigned int found)
}
#endif
+#ifdef USE_LZO
+ if (found & OPT_P_COMP)
+ {
+ if (lzo_defined (&c->c2.lzo_compwork))
+ {
+ msg (D_PUSH, "OPTIONS IMPORT: LZO parms modified");
+ lzo_modify_flags (&c->c2.lzo_compwork, c->options.lzo);
+ }
+ }
+#endif
+
if (found & OPT_P_SHAPER)
{
msg (D_PUSH, "OPTIONS IMPORT: traffic shaper enabled");
@@ -1474,7 +1486,7 @@ do_init_frame (struct context *c)
/*
* Initialize LZO compression library.
*/
- if (c->options.comp_lzo)
+ if (c->options.lzo & LZO_SELECTED)
{
lzo_adjust_frame_parameters (&c->c2.frame);
@@ -1493,7 +1505,7 @@ do_init_frame (struct context *c)
lzo_adjust_frame_parameters (&c->c2.frame_fragment_omit); /* omit LZO frame delta from final frame_fragment */
#endif
}
-#endif
+#endif /* USE_LZO */
#ifdef ENABLE_SOCKS
/*
@@ -2404,8 +2416,8 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
#ifdef USE_LZO
/* initialize LZO compression library. */
- if (options->comp_lzo && (c->mode == CM_P2P || child))
- lzo_compress_init (&c->c2.lzo_compwork, options->comp_lzo_adaptive);
+ if ((options->lzo & LZO_SELECTED) && (c->mode == CM_P2P || child))
+ lzo_compress_init (&c->c2.lzo_compwork, options->lzo);
#endif
/* initialize MTU variables */
@@ -2496,7 +2508,7 @@ close_instance (struct context *c)
do_close_check_if_restart_permitted (c);
#ifdef USE_LZO
- if (c->options.comp_lzo)
+ if (lzo_defined (&c->c2.lzo_compwork))
lzo_compress_uninit (&c->c2.lzo_compwork);
#endif