aboutsummaryrefslogtreecommitdiff
path: root/samples/daytimeclnt.lua (unfollow)
Commit message (Collapse)AuthorFilesLines
3 daysAdd HTTP response headers callback to allow for early abort or different ↵Frans de Jonge1-0/+12
sink depending on response
3 daysAdd Lua 5.5 support (#473)Caleb Maclennan5-5/+12
3 dayschore(docs): Backfill changelog entries for merged PRs and assorted commitsCaleb Maclennan1-0/+17
4 daysfeat(core): Handle response code 308 permanent redirectAmanda Stjerna1-1/+1
4 dayschore(docs): add docs for SO_EXCLUSIVEADDRUSE and othersThijs Schreijer2-5/+71
Adds docs for the option, but also adds the docs for other options present in the code but missing from the docs.
4 daysfeat(core): Add option for Windows SO_EXCLUSIVEADDRUSEWires774-0/+37
4 dayschore(test): add 2 tests reusing partial resultsThijs Schreijer1-3/+20
Tests to show the socket isn't left in an undetermined state due to dataloss, since the partial results are returned to the user.
4 daysfix(http): bracket IPv6 host in Host headerThijs Schreijer1-1/+2
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
4 daysfeat(url): classify host as name/ipv4/ipv6 in parse and buildThijs Schreijer3-6/+325
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.
4 daysfix(udp): receive(0) tests and bad call to getnameinfoThijs Schreijer6-1/+490
5 daysfix(receive): a receive 0 should immediately return, not blockThijs Schreijer5-10/+53
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
5 daysApply code review suggestionsThijs Schreijer2-1/+4
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
5 daysfeat(headers): dynamically create cononicalized headersThijs Schreijer4-97/+206
Instead of a static list dynamically add entries in proper casing. Also allowing to add non-standard ones through `setcanonic`. closes #442 fixes #440
5 daysfeat(http/ftp/smtp): implement max size checksThijs Schreijer5-8/+238
fixes unbounded reads when using the "*l" pattern. Typically on headers and other control lines.
5 daysrefactor(receive): make implicit line reads explicitThijs Schreijer2-7/+7
5 daysfix(receive): guard numeric pattern against size_t overflow on castThijs Schreijer2-3/+6
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.
5 daysfix(receive): guard maxsize against size_t overflow on castThijs Schreijer2-3/+6
Casting a double larger than SIZE_MAX to size_t is undefined behavior; bound-check maxsize before the cast.
2026-08-17chore(docs): some cleanupThijs Schreijer1-46/+6
2026-08-13chore(deps): bump luarocks/gh-actions-lua in the github-actions group (#468)dependabot[bot]1-1/+1
2026-07-30chore(deps): bump the github-actions group with 2 updates (#465)dependabot[bot]2-3/+3
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-30chore: add Dependabot config and pin GitHub Actions to git SHAs (#464)Copilot4-9/+24
2026-07-30feat(receive): add maxsize argument to bound memory usageThijs Schreijer5-23/+366
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.
2025-11-14feat(udp): Allow changing UDP_DATAGRAMSIZE at compile time (#452)Victor Bombi1-0/+2
2025-05-30ci: Switch back to luarocks instance of GH actionCaleb Maclennan1-1/+2
2025-05-29feat: Add ucrt64 support in makefile (#455)Raffaello Bertini2-2/+27
2025-05-29ci: Fix the build for LuaJIT and OpenResty on Windows (#453)Luau1-1/+2
2025-03-31docs: Improve installation instructions, focus on LuaRocks installation (#454)Sharad Singh1-55/+15
2025-03-01fix: Use a macos version supported by GitHub Actionsluau-project1-1/+1
2025-03-01ci: Use GitHub Actions from luarocks namespaceluau-project1-2/+2
2025-02-23docs: Remove unnecessary `value` argument from gettimeoutMasak11-2/+2
2025-02-23docs: Fix udp documentation gettimeout typoMasak11-2/+2
2024-06-29chore: Remove the executable permission bit from some source files (#434)Tianjia Zhang15-0/+0
2024-05-24fix(unix): Pass correct path length for abstract sockets (#430)Kim Alvefur2-41/+42
2024-03-15chore(docs): update LTN12 links (#428)Thijs Schreijer5-20/+20
2024-03-05fix(docs): link to included LTN documents (#426)Thijs Schreijer2-1/+10
2024-02-12chore(http): Correct typos in error message and code comments (#423)Alexandre Detiste3-6/+6
2023-11-23fix(http): Use the right protocol for proxies (#386)Max1Truc1-3/+8
2023-11-13fix(http): Correct receiveheaders() handling of folded values (#420)_AMD_1-1/+1
2023-11-11style(docs): Trim trailing whitespace in HTML docsCaleb Maclennan3-82/+82
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
2023-11-11chore(core): Update version markers to last released versionCaleb Maclennan4-4/+4
Closes #401
2023-11-11feat(rockspec): Ship mbox parser with LuaRocks, already packaged in some distrosCaleb Maclennan1-0/+1
Closes #324
2023-11-09fix(wsocket): Properly report CONNRESET (#81)Paul Kulchenko1-0/+2
2023-11-08fix(url): Avoid fragment being part of authority, allows parsing empty pathsCaleb Maclennan1-1/+1
2023-11-08fix(url): Avoid query string being part of authority, allows parsing empty pathsCaleb Maclennan1-1/+1
2023-11-08fix(inet): Return port as number in getsockname (#392)georgeto1-1/+1
2023-11-08ci: Update Luacheck to v1+, use newer Ubuntu runner imagesCaleb Maclennan2-4/+4
2023-11-08ci: Identify CI jobs better and skip irrelevant platform specific stepsCaleb Maclennan1-3/+3
2023-10-27ci: Enable windows buildleso-kn1-4/+9
2023-10-27refactor(core): Replace check for SO_BINDTODEVICE support with platform ↵leso-kn1-2/+2
independent version
2023-10-27fix(core): Disable SO_BINDTODEVICE on windowsleso-kn1-2/+2
Co-authored-by: Sewbacca <sebastian.kalus@kolabnow.com>