summaryrefslogtreecommitdiffstats
path: root/reg-tests/lua/h_txn_get_priv.lua
diff options
context:
space:
mode:
Diffstat (limited to 'reg-tests/lua/h_txn_get_priv.lua')
-rw-r--r--reg-tests/lua/h_txn_get_priv.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/reg-tests/lua/h_txn_get_priv.lua b/reg-tests/lua/h_txn_get_priv.lua
new file mode 100644
index 0000000..999ea88
--- /dev/null
+++ b/reg-tests/lua/h_txn_get_priv.lua
@@ -0,0 +1,15 @@
+core.register_action("bug", { "http-res" }, function(txn)
+ data = txn:get_priv()
+ if not data then
+ data = 0
+ end
+ data = data + 1
+ print(string.format("set to %d", data))
+ txn.http:res_set_status(200 + data)
+ txn:set_priv(data)
+end)
+
+core.register_service("fakeserv", "http", function(applet)
+ applet:set_status(200)
+ applet:start_response()
+end)