Mercurial Hosting > luan
comparison src/luan/modules/host/Hosting.luan @ 1120:e8fc6712b468
luan Rpc uses luan.lib.rpc
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 07 Aug 2017 23:50:52 -0600 |
parents | bae2d0c2576c |
children | ae2321a09723 |
comparison
equal
deleted
inserted
replaced
1119:87c674f3f6b7 | 1120:e8fc6712b468 |
---|---|
57 end | 57 end |
58 | 58 |
59 process( nil, tree, my_dir ) | 59 process( nil, tree, my_dir ) |
60 | 60 |
61 host.update_handler(domain,password) | 61 host.update_handler(domain,password) |
62 host.close() | |
62 end | 63 end |
63 | 64 |
64 function Hosting.delete(domain,password) | 65 function Hosting.delete(domain,password) |
65 local host = Rpc.remote(domain) | 66 local host = Rpc.remote(domain) |
66 host.delete(domain,password) | 67 host.delete(domain,password) |
68 host.close() | |
67 end | 69 end |
68 | 70 |
69 function Hosting.exists(domain) | 71 function Hosting.exists(domain) |
70 local host = Rpc.remote(domain) | 72 local host = Rpc.remote(domain) |
71 return host.exists(domain) | 73 local rtn = host.exists(domain) |
74 host.close() | |
75 return rtn | |
72 end | 76 end |
73 | 77 |
74 function Hosting.change_domain(old_domain,new_domain,password) | 78 function Hosting.change_domain(old_domain,new_domain,password) |
75 local host = Rpc.remote(new_domain) | 79 local host = Rpc.remote(new_domain) |
76 return host.change_domain(old_domain,new_domain,password) | 80 local rtn = host.change_domain(old_domain,new_domain,password) |
81 host.close() | |
82 return rtn | |
77 end | 83 end |
78 | 84 |
79 function Hosting.change_password(domain,old_password,new_password) | 85 function Hosting.change_password(domain,old_password,new_password) |
80 local host = Rpc.remote(domain) | 86 local host = Rpc.remote(domain) |
81 return host.change_password(domain,old_password,new_password) | 87 local rtn = host.change_password(domain,old_password,new_password) |
88 host.close() | |
89 return rtn | |
82 end | 90 end |
83 | 91 |
84 function Hosting.caller(domain) | 92 function Hosting.caller(domain) |
85 local host = Rpc.remote(domain) | 93 local host = Rpc.remote(domain) |
86 local mt = {} | 94 local mt = {} |
87 function mt.__index(_,key) | 95 function mt.__index(_,key) |
88 return function(...) | 96 return function(...) |
97 if key == "close" then | |
98 return host.close() | |
99 end | |
89 return host.call(domain,key,...) | 100 return host.call(domain,key,...) |
90 end | 101 end |
91 end | 102 end |
92 local t = {} | 103 local t = {} |
93 set_metatable(t,mt) | 104 set_metatable(t,mt) |