mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-04 16:57:58 +00:00
MINOR: lua: Use vars_unset_by_name_ifexist()
There is no good reason to register a variable name, just to unset that value that could not even be set without the variable existing. This change should be safe, may be backported if desired.
This commit is contained in:
parent
de5021a133
commit
94fa973f3e
@ -3512,7 +3512,7 @@ __LJMP static int hlua_applet_tcp_unset_var(lua_State *L)
|
||||
|
||||
/* Unset the variable. */
|
||||
smp_set_owner(&smp, s->be, s->sess, s, 0);
|
||||
vars_unset_by_name(name, len, &smp);
|
||||
vars_unset_by_name_ifexist(name, len, &smp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3990,7 +3990,7 @@ __LJMP static int hlua_applet_http_unset_var(lua_State *L)
|
||||
|
||||
/* Unset the variable. */
|
||||
smp_set_owner(&smp, s->be, s->sess, s, 0);
|
||||
vars_unset_by_name(name, len, &smp);
|
||||
vars_unset_by_name_ifexist(name, len, &smp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5074,7 +5074,7 @@ __LJMP static int hlua_unset_var(lua_State *L)
|
||||
|
||||
/* Unset the variable. */
|
||||
smp_set_owner(&smp, htxn->p, htxn->s->sess, htxn->s, htxn->dir & SMP_OPT_DIR);
|
||||
vars_unset_by_name(name, len, &smp);
|
||||
vars_unset_by_name_ifexist(name, len, &smp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user