Kim Alvefur
ed25cd6f85
util.sslconfig: Recognise TLS 1.3 as a protocol version
...
This enables it to understand protocol = "tlsv1_3+"
8 years ago
Kim Alvefur
a261de73b9
util.serialization: Encode non-fatal error in way that can be restored
...
It could previously encode to eg `{ [nil] = ... }` which doesn't get decoded
8 years ago
Kim Alvefur
1497806989
util.serialization: Rename non-fatal fallback handler for clarity
8 years ago
Kim Alvefur
28031d133d
util.serialization: Disable use of unquoted table keys by default
...
For safety against future new keywords
8 years ago
Kim Alvefur
fdbc23fab6
util.serialization: Add option for allowing multiple references to the same table (but not cycles)
8 years ago
Kim Alvefur
bdadc69e1a
util.serialization: Separate errors for multiple table references and max depth
8 years ago
Kim Alvefur
97c56e6c71
util.serialization: Make maximum table depth configurable
8 years ago
Matthew Wild
f5f6460b2e
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
8 years ago
Matthew Wild
1454ac8208
util.xpcall, util.compat: Add non-hacky multi-argument xpcall() for Lua 5.1
8 years ago
Matthew Wild
9fdfa590d2
util.dependencies: Remove ztact compatability warning
8 years ago
Matthew Wild
6990069677
util.promise: Switch from pcall to xpcall to get tracebacks on exceptions
8 years ago
Matthew Wild
8ea77fc0ec
util.promise: Remove the non-standard ability to pass a promise to reject()
8 years ago
Matthew Wild
e6ff6e333c
util.promise: Fix missing parameters
8 years ago
Matthew Wild
b74a643e34
util.promise: Ensure chained promises always receive a value/rejection even if an intermediate promise has no handlers
8 years ago
Matthew Wild
c7d9ee0bb8
util.promise: Export is_promise()
8 years ago
Matthew Wild
5d8613b3c1
util.promise: Remove debug print and assert
8 years ago
Kim Alvefur
eaac53d041
util.pubsub: Clarify comment about return value
8 years ago
Matthew Wild
e12a6cdb99
util.array: Add __div for parity with util.set
8 years ago
Matthew Wild
fbb11b868f
util.array: Break long line
8 years ago
Matthew Wild
05b4064188
util.promise: Add promise.try()
8 years ago
Matthew Wild
44b3954d56
util.pubsub: Allow publishing with a config that should be used as defaults only
8 years ago
Kim Alvefur
dd2f749996
util.promise: Add a string representation
8 years ago
Matthew Wild
681b25e427
util.promise: Add promise:finally()
8 years ago
Matthew Wild
894fe1b808
util.promise: Some code relocation
8 years ago
Matthew Wild
7bcf751702
util.promise: Also support automatic resolution by returning a promise from an on_reject handler
...
Originally unimplemented because it wasn't clear to me what the correct behaviour was, but the A+
spec is clear that both onFulfilled and onRejected may return a promise.
8 years ago
Matthew Wild
ef7d6ba99e
util.promise: Fix promise.reject() to return a rejected promise, and fix buggy test for it
8 years ago
Kim Alvefur
0247a0e904
mod_http: Move normalize_path to util.http
8 years ago
Kim Alvefur
284152ba25
util.dependencies: Add compat code for normalization of socket constructors
...
Old LuaSocket had only tcp() which was IPv4-only. LuaSocket ~3.0 adds a
tcp6() that creates a IPv6 socket. Some version moves tcp() to tcp4()
and adds an IP-version-agnostic tcp() constructor.
8 years ago
Kim Alvefur
e2321c4d37
util.stanza: Set preserialize as freeze metamethod
8 years ago
Kim Alvefur
1ab9729aac
util.set: Add freeze metamethod
8 years ago
Kim Alvefur
15ba5f41b1
util.array: Add freeze metamethod
8 years ago
Kim Alvefur
1789a7adf8
util.serialization: Remove encoding of very large or very small numbers in scientific notation
...
Also difficult to describe this option, easier to remove it.
%.18g covers a very large range of numbers
8 years ago
Kim Alvefur
e0a16c75dc
util.serialization: Simpler metatable pre-processing
...
It was too difficult to describe what it did.
8 years ago
Kim Alvefur
8d941e5d0f
util.serialization: Use '=' prefix for chunk source description
...
Like in bd5e4485a245
8 years ago
Kim Alvefur
09c19925cc
util.serialization: Make check of prefix for optional hex encoding stricter
8 years ago
Kim Alvefur
e99c680a14
util.serialization: Make errors fatal by default (like the previous implementation)
8 years ago
Matthew Wild
e557cfb012
util.promise: ES6-like API for promises
8 years ago
Kim Alvefur
ed7c24bd0d
util.serialization: Stricter type check
8 years ago
Matthew Wild
809db57f68
util.json: Use util.iterators.sorted_pairs() in ordered mode
8 years ago
Matthew Wild
c65893de6e
util.iterators: Add sorted_pairs() method
8 years ago
Kim Alvefur
dae66b0b3f
util.jid: Add missing semicolon
8 years ago
Kim Alvefur
759fe72f49
util.stanza: Add method for removing all children with a specific name, xmlns
8 years ago
Matthew Wild
27d8902b8e
util.stanza: Don't automatically generate ids for iq stanzas
...
Users of this API should provide their own id attribute that meets their
uniqueness requirements.
The current implementation leaks information (i.e. how many iq stanzas
have been sent by the server to other JIDs). Providing any strong
guarantees of randomness here would need to pull in additional
dependencies that we don't want in this simple library.
8 years ago
Kim Alvefur
715b488722
util.dataforms: Improve default error message for failed datatype validation
8 years ago
Kim Alvefur
9c1528bf2e
util.dataforms: Add support for XEP-0122: Data Forms Validation
...
Initially only basic validation of xs:integer
8 years ago
Kim Alvefur
3da47d7dde
util.dataforms: Allow field names to be different from the 'var' attribute
...
This should allow the usage of long prefixes and namespace-like names to
be contained to the XML representation of the form, so that the code can
use more convenient names.
8 years ago
Kim Alvefur
fb2fdc660b
util.pubsub: Expand comment on return type from get_items
8 years ago
Kim Alvefur
a60bb9bb13
util.pubsub: Explicitly add all capabilities to the 'outcast' affiliation for completeness
8 years ago
Kim Alvefur
df5360e6a3
util.pubsub: Comments describing the return values of methods
8 years ago
Matthew Wild
11c4cee97a
util.pubsub: Add 'service' field to all events
8 years ago