summaryrefslogtreecommitdiffstats
path: root/client/test.lua
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-03-08 16:42:03 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2013-03-08 16:51:15 +0100
commit3e2d86693f6e8920c97fe296491e7741e31f922c (patch)
tree1c755422fd27c7f192243e8eb7f7811193efa1f6 /client/test.lua
parente0cabd6295204fe8a6b54edfc9141302943fdbfb (diff)
downloadprivsep-master.tar.bz2
privsep-master.tar.xz
implement one lua state per connectionHEADmaster
This allows you load various modules into a server lua state and give a performance boost when calling the privileged functions
Diffstat (limited to 'client/test.lua')
-rw-r--r--client/test.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/client/test.lua b/client/test.lua
new file mode 100644
index 0000000..38e7429
--- /dev/null
+++ b/client/test.lua
@@ -0,0 +1,20 @@
+
+ps = require("privsep")
+
+c = ps.connect()
+
+mymod = c:wrap("mymod")
+
+if mymod == nil then
+ print("mymod is nil")
+end
+
+pos = require("posix")
+
+print(mymod.myfunc("arg1", true))
+for i = 1, 1000 do
+ mymod.myfunc("foo", false)
+end
+
+c:close()
+