Software /
code /
prosody
Annotate
teal-src/util/error.d.tl @ 11590:5aafb832c91b
core.portmanager: Fix race condition in initialization of SNI cert map
Under some circumstances when hosts and modules are loaded in some
certain order, entries end up missing from the SNI map. This manifests
in e.g. `curl https://localhost:5281/` giving an error about
"unrecognized name".
The `service` argument is `nil` when invoked from the "host-activated"
event, leading it to iterating over every service. And then it would not
be fetching e.g. `http_host` from the config, which explains why https
would sometimes not work due to the missing name entry.
Because when `service` is included, this limits the iteration to
matching entries, while also returning the same value as the `name` loop
variable. Because `name == service when service != nil` we can use name
instead in the body of the loop.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 28 May 2021 17:09:22 +0200 |
parent | 11459:86904555bffc |
child | 12626:608443cc765c |
rev | line source |
---|---|
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local enum error_type |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 "auth" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 "cancel" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 "continue" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 "modify" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 "wait" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 local enum error_condition |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 "bad-request" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 "conflict" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 "feature-not-implemented" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 "forbidden" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 "gone" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 "internal-server-error" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 "item-not-found" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 "jid-malformed" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 "not-acceptable" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 "not-allowed" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 "not-authorized" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 "policy-violation" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 "recipient-unavailable" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 "redirect" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 "registration-required" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 "remote-server-not-found" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 "remote-server-timeout" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 "resource-constraint" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 "service-unavailable" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 "subscription-required" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 "undefined-condition" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 "unexpected-request" |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 local record protoerror |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 type : error_type |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 condition : error_condition |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
37 text : string |
11459
86904555bffc
teal: Use new integer support in Teal 0.13.0
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
38 code : integer |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 local record error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 type : error_type |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 condition : error_condition |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 text : string |
11459
86904555bffc
teal: Use new integer support in Teal 0.13.0
Kim Alvefur <zash@zash.se>
parents:
11432
diff
changeset
|
45 code : integer |
11432
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 context : { any : any } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 source : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 local type compact_registry_item = { string, string, string, string } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 local type compact_registry = { compact_registry_item } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 local type registry = { string : protoerror } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 local type context = { string : any } |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
55 local record error_registry_wrapper |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
56 source : string |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
57 registry : registry |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
58 new : function (string, context) : error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
59 coerce : function (any, string) : any, error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
60 wrap : function (error) : error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
61 wrap : function (string, context) : error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
62 is_error : function (any) : boolean |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
63 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
64 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
65 local record lib |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
66 record configure_opt |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
67 auto_inject_traceback : boolean |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
68 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
69 new : function (protoerror, context, { string : protoerror }, string) : error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
70 init : function (string, string, registry | compact_registry) : error_registry_wrapper |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
71 init : function (string, registry | compact_registry) : error_registry_wrapper |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
72 is_error : function (any) : boolean |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
73 coerce : function (any, string) : any, error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
74 from_stanza : function (table, context, string) : error |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
75 configure : function |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
76 end |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
77 |
113f3912c7cb
util: Add Teal interface definition files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
78 return lib |