Skip to content

Commit 45cdb0e

Browse files
nowaitsvictorhora
authored andcommitted
fix: function m.setvar not work in lua script
1 parent c2bc695 commit 45cdb0e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/engine/lua.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,26 +371,32 @@ int Lua::setvar(lua_State *L) {
371371

372372
if (collection == "TX") {
373373
t->m_collections.m_tx_collection->storeOrUpdateFirst(
374-
"TX:" + variableName, "", var_value);
374+
variableName,
375+
var_value);
375376
}
376377
else if (collection == "IP") {
377378
t->m_collections.m_ip_collection->storeOrUpdateFirst(
378-
"IP:" + variableName, t->m_collections.m_ip_collection_key,
379+
variableName, t->m_collections.m_ip_collection_key,
380+
t->m_rules->m_secWebAppId.m_value,
379381
var_value);
380382
}
381383
else if (collection == "GLOBAL") {
382384
t->m_collections.m_global_collection->storeOrUpdateFirst(
383-
"GLOBAL:" + variableName, t->m_collections.m_global_collection_key,
385+
variableName, t->m_collections.m_global_collection_key,
386+
t->m_rules->m_secWebAppId.m_value,
384387
var_value);
385388
}
386389
else if (collection == "RESOURCE") {
387390
t->m_collections.m_resource_collection->storeOrUpdateFirst(
388-
"RESOURCE:" + variableName,
389-
t->m_collections.m_resource_collection_key, var_value);
391+
variableName,
392+
t->m_collections.m_resource_collection_key,
393+
t->m_rules->m_secWebAppId.m_value,
394+
var_value);
390395
}
391396
else if (collection == "SESSION") {
392397
t->m_collections.m_session_collection->storeOrUpdateFirst(
393-
"SESSION:" + variableName, t->m_collections.m_session_collection_key,
398+
variableName, t->m_collections.m_session_collection_key,
399+
t->m_rules->m_secWebAppId.m_value,
394400
var_value);
395401
}
396402

0 commit comments

Comments
 (0)