Software / code / prosody
Annotate
teal-src/module.d.tl @ 13652:a08065207ef0
net.server_epoll: Call :shutdown() on TLS sockets when supported
Comment from Matthew:
This fixes a potential issue where the Prosody process gets blocked on sockets
waiting for them to close. Unlike non-TLS sockets, closing a TLS socket sends
layer 7 data, and this can cause problems for sockets which are in the process
of being cleaned up.
This depends on LuaSec changes which are not yet upstream.
From Martijn's original email:
So first my analysis of luasec. in ssl.c the socket is put into blocking
mode right before calling SSL_shutdown() inside meth_destroy(). My best
guess to why this is is because meth_destroy is linked to the __close
and __gc methods, which can't exactly be called multiple times and
luasec does want to make sure that a tls session is shutdown as clean
as possible.
I can't say I disagree with this reasoning and don't want to change this
behaviour. My solution to this without changing the current behaviour is
to introduce a shutdown() method. I am aware that this overlaps in a
conflicting way with tcp's shutdown method, but it stays close to the
OpenSSL name. This method calls SSL_shutdown() in the current
(non)blocking mode of the underlying socket and returns a boolean
whether or not the shutdown is completed (matching SSL_shutdown()'s 0
or 1 return values), and returns the familiar ssl_ioerror() strings on
error with a false for completion. This error can then be used to
determine if we have wantread/wantwrite to finalize things. Once
meth_shutdown() has been called once a shutdown flag will be set, which
indicates to meth_destroy() that the SSL_shutdown() has been handled
by the application and it shouldn't be needed to set the socket to
blocking mode. I've left the SSL_shutdown() call in the
LSEC_STATE_CONNECTED to prevent TOCTOU if the application reaches a
timeout for the shutdown code, which might allow SSL_shutdown() to
clean up anyway at the last possible moment.
Another thing I've changed to luasec is the call to socket_setblocking()
right before calling close(2) in socket_destroy() in usocket.c.
According to the latest POSIX[0]:
Note that the requirement for close() on a socket to block for up to
the current linger interval is not conditional on the O_NONBLOCK
setting.
Which I read to mean that removing O_NONBLOCK on the socket before close
doesn't impact the behaviour and only causes noise in system call
tracers. I didn't touch the windows bits of this, since I don't do
windows.
For the prosody side of things I've made the TLS shutdown bits resemble
interface:onwritable(), and put it under a combined guard of self._tls
and self.conn.shutdown. The self._tls bit is there to prevent getting
stuck on this condition, and self.conn.shutdown is there to prevent the
code being called by instances where the patched luasec isn't deployed.
The destroy() method can be called from various places and is read by
me as the "we give up" error path. To accommodate for these unexpected
entrypoints I've added a single call to self.conn:shutdown() to prevent
the socket being put into blocking mode. I have no expectations that
there is any other use here. Same as previous, the self.conn.shutdown
check is there to make sure it's not called on unpatched luasec
deployments and self._tls is there to make sure we don't call shutdown()
on tcp sockets.
I wouldn't recommend logging of the conn:shutdown() error inside
close(), since a lot of clients simply close the connection before
SSL_shutdown() is done.
| author | Martijn van Duren <martijn@openbsd.org> |
|---|---|
| date | Thu, 06 Feb 2025 15:04:38 +0000 |
| parent | 13328:36284c879e2f |
| rev | line source |
|---|---|
|
12979
fbbf4f0db8f0
teal: Move into prosody namespace
Kim Alvefur <zash@zash.se>
parents:
12643
diff
changeset
|
1 local st = require "prosody.util.stanza" |
|
11941
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 global record moduleapi |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 get_name : function (moduleapi) : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 get_host : function (moduleapi) : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 enum host_type |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 "global" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 "local" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 "component" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 get_host_type : function (moduleapi) : host_type |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 set_global : function (moduleapi) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 add_feature : function (moduleapi, string) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 add_identity : function (moduleapi, string, string, string) -- TODO enum? |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 add_extension : function (moduleapi, st.stanza_t) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 fire_event : function (moduleapi, string, any) : any |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 type handler = function (any) : any |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 record util_events |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 -- TODO import def |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 hook_object_event : function (moduleapi, util_events, string, handler, number) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 unhook_object_event : function (moduleapi, util_events, string, handler) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 hook : function (moduleapi, string, handler, number) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 hook_global : function (moduleapi, string, handler, number) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 hook_tag : function (moduleapi, string, string, handler, number) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 unhook : function (moduleapi, string, handler) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 wrap_object_event : function (moduleapi, util_events, string, handler) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 wrap_event : function (moduleapi, string, handler) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 wrap_global : function (moduleapi, string, handler) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 require : function (moduleapi, string) : table |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 depends : function (moduleapi, string) : table |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 shared : function (moduleapi, string) : table |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 type config_getter = function<A> (moduleapi, string, A) : A |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 get_option : config_getter<any> |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 get_option_scalar : config_getter<nil | boolean | number | string> |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 get_option_string : config_getter<string> |
| 13328 | 37 get_option_number : function (moduleapi, string, number, number, number) : number |
| 38 get_option_integer : function (moduleapi, string, integer, integer, integer) : integer | |
|
11941
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 get_option_boolean : config_getter<boolean> |
| 13328 | 40 get_option_enum : function<A> (moduleapi, string, ... : A) : A |
| 41 get_option_period : function (moduleapi, string|number, string|number, string|number, string|number) : number | |
|
11941
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 record util_array |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 -- TODO import def |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 { any } |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 get_option_array : config_getter<util_array> |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 record util_set |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 -- TODO import def |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 _items : { any : boolean } |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 get_option_set : function (moduleapi, string, { any }) : util_set |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 get_option_inherited_set : function (moduleapi, string, { any }) : util_set |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 get_option_path : function (moduleapi, string, string, string) : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 context : function (moduleapi, string) : moduleapi |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
55 add_item : function (moduleapi, string, any) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
56 remove_item : function (moduleapi, string, any) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
57 get_host_items : function (moduleapi, string) : { any } |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
58 handle_items : function (moduleapi, string, handler, handler, boolean) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
59 provides : function (moduleapi, string, table) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
60 record util_session |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
61 -- TODO import def |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
62 send : function ( st.stanza_t | string ) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
63 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
64 send : function (moduleapi, st.stanza_t, util_session) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
65 send_iq : function (moduleapi, st.stanza_t, util_session, number) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
66 broadcast : function (moduleapi, { string }, st.stanza_t, function) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
67 type timer_callback = function (number, ... : any) : number |
|
12502
5862ddf71e3c
teal/moduleapi: Describe timer wrapper
Kim Alvefur <zash@zash.se>
parents:
11941
diff
changeset
|
68 record timer_wrapper |
|
5862ddf71e3c
teal/moduleapi: Describe timer wrapper
Kim Alvefur <zash@zash.se>
parents:
11941
diff
changeset
|
69 stop : function (timer_wrapper) |
|
5862ddf71e3c
teal/moduleapi: Describe timer wrapper
Kim Alvefur <zash@zash.se>
parents:
11941
diff
changeset
|
70 disarm : function (timer_wrapper) |
|
5862ddf71e3c
teal/moduleapi: Describe timer wrapper
Kim Alvefur <zash@zash.se>
parents:
11941
diff
changeset
|
71 reschedule : function (timer_wrapper, number) |
|
5862ddf71e3c
teal/moduleapi: Describe timer wrapper
Kim Alvefur <zash@zash.se>
parents:
11941
diff
changeset
|
72 end |
|
5862ddf71e3c
teal/moduleapi: Describe timer wrapper
Kim Alvefur <zash@zash.se>
parents:
11941
diff
changeset
|
73 add_timer : function (moduleapi, number, timer_callback, ... : any) : timer_wrapper |
|
11941
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
74 get_directory : function (moduleapi) : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
75 enum file_mode |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
76 "r" "w" "a" "r+" "w+" "a+" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
77 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
78 load_resource : function (moduleapi, string, file_mode) : FILE |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
79 enum store_type |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
80 "keyval" |
|
13001
5883e78b6165
teal-src: Add keyval+ store type
Matthew Wild <mwild1@gmail.com>
parents:
12979
diff
changeset
|
81 "keyval+" |
|
11941
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
82 "map" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
83 "archive" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
84 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
85 open_store : function (moduleapi, string, store_type) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
86 enum stat_type |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
87 "amount" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
88 "counter" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
89 "rate" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
90 "distribution" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
91 "sizes" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
92 "times" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
93 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
94 record stats_conf |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
95 initial : number |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
96 units : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
97 type : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
98 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
99 measure : function (moduleapi, string, stat_type, stats_conf) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
100 measure_object_event : function (moduleapi, util_events, string, string) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
101 measure_event : function (moduleapi, string, string) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
102 measure_global_event : function (moduleapi, string, string) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
103 enum status_type |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
104 "error" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
105 "warn" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
106 "info" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
107 "core" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
108 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
109 set_status : function (moduleapi, status_type, string, boolean) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
110 enum log_level |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
111 "debug" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
112 "info" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
113 "warn" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
114 "error" |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
115 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
116 log_status : function (moduleapi, log_level, string, ... : any) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
117 get_status : function (moduleapi) : status_type, string, number |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
118 |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
119 -- added by modulemanager |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
120 name : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
121 host : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
122 _log : function (log_level, string, ... : any) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
123 log : function (moduleapi, log_level, string, ... : any) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
124 reloading : boolean |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
125 saved_state : any |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
126 record module_environment |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
127 module : moduleapi |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
128 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
129 environment : module_environment |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
130 path : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
131 resource_path : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
132 |
|
12643
9fa749cbd376
teal-src: update module.d.tl with new access control methods
Matthew Wild <mwild1@gmail.com>
parents:
12502
diff
changeset
|
133 -- access control |
|
9fa749cbd376
teal-src: update module.d.tl with new access control methods
Matthew Wild <mwild1@gmail.com>
parents:
12502
diff
changeset
|
134 may : function (moduleapi, string, table|string) |
|
9fa749cbd376
teal-src: update module.d.tl with new access control methods
Matthew Wild <mwild1@gmail.com>
parents:
12502
diff
changeset
|
135 default_permission : function (string, string) |
|
9fa749cbd376
teal-src: update module.d.tl with new access control methods
Matthew Wild <mwild1@gmail.com>
parents:
12502
diff
changeset
|
136 default_permissions : function (string, { string }) |
|
9fa749cbd376
teal-src: update module.d.tl with new access control methods
Matthew Wild <mwild1@gmail.com>
parents:
12502
diff
changeset
|
137 |
|
11941
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
138 -- methods the module can add |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
139 load : function () |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
140 add_host : function (moduleapi) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
141 save : function () : any |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
142 restore : function (any) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
143 unload : function () |
|
13109
5469045ef7f0
teal: Describe http_url method
Kim Alvefur <zash@zash.se>
parents:
13001
diff
changeset
|
144 |
|
5469045ef7f0
teal: Describe http_url method
Kim Alvefur <zash@zash.se>
parents:
13001
diff
changeset
|
145 -- added by mod_http |
|
5469045ef7f0
teal: Describe http_url method
Kim Alvefur <zash@zash.se>
parents:
13001
diff
changeset
|
146 http_url : function (moduleapi, string, string, string) : string |
|
11941
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
147 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
148 |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
149 global module : moduleapi |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
150 |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
151 global record common_event |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
152 stanza : st.stanza_t |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
153 record origin |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
154 send : function (st.stanza_t) |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
155 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
156 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
157 |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
158 global record prosody |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
159 version : string |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
160 end |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
161 |
|
cfd37453e6b6
teal: Describe the module API interface
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
162 return module |