| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pre-release documentation audit against master. Adds the two fully
undocumented modules and closes gaps found by diffing every docs/*.html
page against its corresponding source:
- New docs/unix.html and docs/serial.html (socket.unix stream/dgram and
socket.serial were never documented), linked from index.html,
introduction.html, socket.html and reference.html. serial.html notes
the current lack of a baud/parity/flow-control API and includes an
os.execute+stty workaround example. Both note Windows is unsupported.
- socket.html: document headers.setcanonic, point to unix/serial modules.
- tcp.html: document getfamily, setpeername/setsockname aliases.
- udp.html: document getfamily, getfd/setfd, dirty; document the
ipv6-multicast-hops/ipv6-unicast-hops aliasing as current (known-buggy)
behavior rather than the originally intended semantics.
- http.html: correct redirect text (301/302/303/307/308, was 301/302
only); document MAXHEADERLINE/MAXHEADERSIZE.
- dns.html: document getnameinfo.
- ltn12.html: document source.rewind and BLOCKSIZE.
- installation.html: fix stale "LuaSocket 3.0" sample output to 3.1.0.
- reference.html: index every anchor added above plus new Unix/Serial
blocks.
|
| | |
|
| | |
|
| | |
|
| |\
| |
| | |
feat(url): classify host as name/ipv4/ipv6 in parse and build
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
The Host header must wrap an IPv6 literal in brackets (RFC 7230), but
adjustheaders() used reqt.host as-is, which is unbracketed after
url.parse(). Use url.classify_host() to detect IPv6 and bracket it,
handling an already-bracketed input without doubling the brackets.
Closes #445
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
parse() now sets hosttype ("name"/"ipv4"/"ipv6") plus a matching
hostname/ipv4/ipv6 field alongside host. build() accepts those same
fields when host is absent, erroring if more than one is set.
classify_host is exported for standalone use; it classifies by shape
(colon present -> ipv6, dotted-quad shape -> ipv4) rather than
validating the address.
|
| |\ \
| | |
| | | |
Fix/http size protect
|
| | | |
| | |
| | |
| | |
| | | |
fixes unbounded reads when using the "*l" pattern. Typically on
headers and other control lines.
|
| | | | |
|
| |\ \ \
| | | |
| | | | |
feat(headers): dynamically create cononicalized headers
|
| | | | |
| | | |
| | | | |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
| | | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of a static list dynamically add entries in proper casing.
Also allowing to add non-standard ones through `setcanonic`.
closes #442
fixes #440
|
| |\ \ \
| | | |
| | | | |
fix(receive): a receive 0 should immediately return, not block
|
| | | | | |
|
| | | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
The fix is slightly more complex because reading from a closed
socket should still return a closed-error.
fixes: #427
fixes: https://github.com/ledgetech/lua-resty-http/pull/313
|
| |\ \ \
| | | |
| | | | |
feat(receive): add maxsize argument to bound memory usage
|
| | |/ /
| | |
| | |
| | |
| | | |
Tests to show the socket isn't left in an undetermined state due
to dataloss, since the partial results are returned to the user.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Same class of bug as the maxsize cast: a double larger than
SIZE_MAX cast to size_t is undefined behavior. Bound-check the
numeric receive pattern before the cast, and cover it with a test.
|
| | | |
| | |
| | |
| | |
| | | |
Casting a double larger than SIZE_MAX to size_t is undefined
behavior; bound-check maxsize before the cast.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
client:receive("*l") and receive("*a") are unbounded: a peer that never
sends a newline, or never closes, makes LuaSocket buffer until the
process runs out of memory (e.g. src/http.lua reading response headers
in a loop). Add an optional maxsize argument that caps the payload a
single call may accumulate, including prefix.
- Hoist all argument validation ahead of timeout_markstart() so bad
calls (maxsize < 1, #prefix >= maxsize, numeric pattern > maxsize)
raise before any I/O and leave the socket untouched.
- recvline/recvall take a budget and return a new internal
BUF_OVERSIZED code, surfaced to Lua as the "oversized" error
alongside "timeout"/"closed", with the partial held in the 3rd
return value.
- recvraw is left untouched: argument checks make the cap unreachable
for numeric patterns.
- Preserve three invariants: a timeout partial is always shorter than
maxsize (safe to retry as prefix), completion beats the cap for *a,
and no bytes are lost or skipped on overflow.
- tcp.c, unixstream.c and serial.c all share this code path unchanged.
Adds test coverage (argument errors, *l/*a boundaries, timeout/close
at the cap, the drain idiom, numeric patterns, unix-stream mirror) and
documents the new argument, error, and recovery idioms in docs/tcp.html.
|
| |\ \ \
| |_|/
|/| | |
Add option for SO_EXCLUSIVEADDRUSE in Windows
|
| | | |
| | |
| | |
| | |
| | | |
Adds docs for the option, but also adds the docs for other
options present in the code but missing from the docs.
|
| | |/ |
|
| | | |
|
| | |
| |
| | |
Signed-off-by: dependabot[bot] <support@github.com>
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| | |
Update CI
|
| | | |
|
| |/ |
|
| |\ |
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Many editors remove these automatically anyway which makes opening and
editng the docs cause a bunch of noise. This is just to get the noise
out of the way in a style commit so it doesn't leak into other PRs
|
| |
|
|
| |
Closes #401
|
| |
|
|
| |
Closes #324
|
| |\ |
|