| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | Merge pull request #472 from lunarmodules/feat/url-hosttype | Caleb Maclennan | 3 days | 1 | -0/+196 |
| |\ | | | | | feat(url): classify host as name/ipv4/ipv6 in parse and build | ||||
| | * | feat(url): classify host as name/ipv4/ipv6 in parse and build | Thijs Schreijer | 4 days | 1 | -0/+196 |
| | | | | | | | | | | | | | | | | | | | | | 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. | ||||
| * | | Merge pull request #467 from lunarmodules/fix/http-size-protect | Caleb Maclennan | 3 days | 2 | -0/+200 |
| |\ \ | | | | | | | Fix/http size protect | ||||
| | * | | feat(http/ftp/smtp): implement max size checks | Thijs Schreijer | 5 days | 2 | -0/+200 |
| | | | | | | | | | | | | | | | | fixes unbounded reads when using the "*l" pattern. Typically on headers and other control lines. | ||||
| * | | | Merge pull request #470 from lunarmodules/header-canon | Caleb Maclennan | 3 days | 1 | -0/+131 |
| |\ \ \ | | | | | | | | | feat(headers): dynamically create cononicalized headers | ||||
| | * | | | Apply code review suggestions | Thijs Schreijer | 5 days | 1 | -1/+1 |
| | | | | | | | | | | | | | Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> | ||||
| | * | | | feat(headers): dynamically create cononicalized headers | Thijs Schreijer | 5 days | 1 | -0/+131 |
| | | |/ | |/| | | | | | | | | | | | | | | | | | | | Instead of a static list dynamically add entries in proper casing. Also allowing to add non-standard ones through `setcanonic`. closes #442 fixes #440 | ||||
| * | | | Merge pull request #471 from lunarmodules/fix/zero-read | Caleb Maclennan | 3 days | 3 | -0/+503 |
| |\ \ \ | | | | | | | | | fix(receive): a receive 0 should immediately return, not block | ||||
| | * | | | fix(udp): receive(0) tests and bad call to getnameinfo | Thijs Schreijer | 4 days | 3 | -0/+467 |
| | | | | | |||||
| | * | | | fix(receive): a receive 0 should immediately return, not block | Thijs Schreijer | 4 days | 1 | -0/+36 |
| | | |/ | |/| | | | | | | | | | | | | | | | | | | | 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 | ||||
| * / | | chore(test): add 2 tests reusing partial results | Thijs Schreijer | 3 days | 1 | -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. | ||||
| * | | fix(receive): guard numeric pattern against size_t overflow on cast | Thijs Schreijer | 5 days | 1 | -2/+4 |
| | | | | | | | | | | | | | 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. | ||||
| * | | fix(receive): guard maxsize against size_t overflow on cast | Thijs Schreijer | 5 days | 1 | -2/+4 |
| | | | | | | | | | | | Casting a double larger than SIZE_MAX to size_t is undefined behavior; bound-check maxsize before the cast. | ||||
| * | | feat(receive): add maxsize argument to bound memory usage | Thijs Schreijer | 2026-07-30 | 2 | -0/+219 |
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
| * | fix(http): Allow relative redirect on https (#395) | Henri D | 2022-10-08 | 1 | -0/+31 |
| | | | | Location header can now be relative: https://httpwg.org/specs/rfc9110.html#field.location | ||||
| * | refactor: Address issues raised by linter | Thijs Schreijer | 2022-03-19 | 9 | -146/+146 |
| | | |||||
| * | test/find-connect-limit: add missing "socket =" | E. Westbrook | 2020-03-28 | 1 | -1/+1 |
| | | |||||
| * | test/udp-zero-length-send-recv: add missing "socket ="; use shebang ↵ | E. Westbrook | 2020-03-28 | 1 | -2/+2 |
| | | | | | "#!/usr/bin/env lua" | ||||
| * | test/udp-zero-length-send: add missing "socket ="; use shebang ↵ | E. Westbrook | 2020-03-28 | 1 | -2/+2 |
| | | | | | "#!/usr/bin/env lua" | ||||
| * | test/getoptions: guard calls with pcall(); check result of getoption"linger" | E. Westbrook | 2020-03-28 | 1 | -4/+18 |
| | | |||||
| * | test/tcp-getoptions: bugfix: missing "socket =" in require"socket" | E. Westbrook | 2020-03-28 | 1 | -1/+1 |
| | | |||||
| * | Merge pull request #116 from linuxmaniac/master | Diego Nehab | 2019-02-24 | 1 | -1/+3 |
| |\ | | | | | Add "tcp-keepidle", "tcp-keepcnt" and "tcp-keepintvl" options | ||||
| | * | Add "tcp-keepidle", "tcp-keepcnt" and "tcp-keepintvl" options | Victor Seva | 2014-12-05 | 1 | -1/+3 |
| | | | |||||
| * | | url.lua:remove_dot_components(): use temporary NUL marker to reduce ↵ | E. Westbrook | 2018-08-21 | 1 | -0/+4 |
| | | | | | | | | | empty-segment special-case code | ||||
| * | | url.lua:remove_dot_components(): empty path component double-dot corner case | E. Westbrook | 2018-08-21 | 1 | -0/+1 |
| | | | |||||
| * | | url.lua:absolute_path(): ensure a separator between base_path and relative_path | E. Westbrook | 2018-08-21 | 1 | -1/+1 |
| | | | |||||
| * | | url.lua:remove_dot_components(): avoid overconsuming dot segments | E. Westbrook | 2018-08-21 | 1 | -0/+5 |
| | | | |||||
| * | | url.lua:remove_dot_components(): limit beginning-of-string double-dot corner ↵ | E. Westbrook | 2018-08-21 | 1 | -0/+1 |
| | | | | | | | | | case to prevent triple-dot activation and authority collision | ||||
| * | | url.lua: separate remove_dot_components() from absolute_path(); also use in ↵ | E. Westbrook | 2018-08-21 | 1 | -4/+4 |
| | | | | | | | | | _M.absolute() even when not merging | ||||
| * | | url.lua:absolute_path(): fix issue #254, simplify, add more test cases | E. Westbrook | 2018-08-19 | 1 | -1/+24 |
| | | | |||||
| * | | Add ltn12.source.table() | E. Westbrook | 2018-06-05 | 1 | -0/+9 |
| | | | |||||
| * | | fixed url parsing; postpone fragment parsing after authority parsing; added ↵ | Herbert Leuwer | 2017-11-22 | 1 | -3/+72 |
| | | | | | | | | | | | | | test cases to test/urltest.lua fixed reference patterns in check_protect() to upper case hex letters | ||||
| * | | Preserve path when parsing urls. | Diego Nehab | 2017-03-20 | 1 | -1/+1 |
| | | | |||||
| * | | rename unix.tcp to unix.stream, unix.udp to unix.dgram | enginix | 2016-12-25 | 4 | -5/+5 |
| | | | |||||
| * | | support datagram unix domain sockets | enginix | 2016-06-24 | 4 | -2/+20 |
| | | | |||||
| * | | Family agostic FTP and expose HTTP/FTP url parsing | Diego Nehab | 2016-03-07 | 1 | -11/+23 |
| | | | |||||
| * | | Don't swallow errors in finalizers. | Philipp Janda | 2016-02-24 | 1 | -1/+0 |
| | | | |||||
| * | | Add more tests for socket.try/protect | mpeterv | 2016-02-21 | 1 | -4/+29 |
| | | | |||||
| * | | Changed buffer-per-socket to buffer-per-operation. | Diego Nehab | 2015-10-06 | 1 | -1/+0 |
| | | | | | | | | | | | | | | | | | This is a difficult tradeoff to measure. I think large datagrams won't be used very frequently. So it is better to not lock a large buffer to each socket object and instead allocate and deallocate for each operation receiving a datagram larger than UDP_DATAGRAMSIZE. | ||||
| * | | Fixes suggested by @Florob in #147. | Diego Nehab | 2015-08-25 | 1 | -7/+12 |
| | | | |||||
| * | | New agnostic IPv4 IPv6 functions. | Diego Nehab | 2015-08-22 | 3 | -53/+51 |
| | | | | | | | | | | | Also dealing with EPROTOTYPE Yosemite seems to be throwing at us for no reason. | ||||
| * | | New compat.h module implements luaL_setfuncs. | Diego Nehab | 2015-08-21 | 1 | -1/+1 |
| | | | | | | | | | Makes initialization code simpler everywhere. | ||||
| * | | Out of the box support for Lua 5.3. | Diego Nehab | 2015-02-18 | 3 | -16/+20 |
| |/ | |||||
| * | support multiple filters in ltn12.{sink,source}.chain() | Fabien Fleutot | 2013-06-18 | 1 | -0/+25 |
| | | |||||
| * | Fix makefile and test_socket_error.lua | Diego Nehab | 2013-06-12 | 1 | -2/+6 |
| | | |||||
| * | Unix domain tests still broken. | Diego Nehab | 2013-05-30 | 2 | -12/+12 |
| | | |||||
| * | Add. Allow get `error` option to socket. | moteus | 2013-05-29 | 1 | -0/+27 |
| | | |||||
| * | Fix. use table.unpack in mimetest on Lua 5.2. | moteus | 2013-05-27 | 1 | -0/+2 |
| | | |||||
| * | Build with Lua 5.2 without LUA_COMPAT_MODULE flag. | moteus | 2013-05-27 | 1 | -2/+2 |
| | | | | | LUASOCKET_USE_GLOBAL flag enable create global variables when load socket/mime modules. | ||||
| * | Fix. Optional IPv6 test | moteus | 2013-05-27 | 1 | -2/+8 |
| | | |||||
