| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | fix(receive): a receive 0 should immediately return, not block | Thijs Schreijer | 5 days | 1 | -10/+13 |
| | | | | | | | | | 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 | ||||
| * | fix(receive): guard numeric pattern against size_t overflow on cast | Thijs Schreijer | 5 days | 1 | -1/+2 |
| | | | | | | | 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 | -1/+2 |
| | | | | | | 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 | 1 | -20/+88 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
| * | Fixe an issue with aux buffer init overwriting optional parameters in ↵ | Paul Kulchenko | 2022-03-18 | 1 | -1/+4 |
| | | | | | | receive() (#334) Fixes use on Lua >= 5.4.3 | ||||
| * | buffer: pragma visibility | E. Westbrook | 2019-03-10 | 1 | -12/+7 |
| | | |||||
| * | buffer.c: use LUASOCKET_PRIVATE | E. Westbrook | 2019-02-25 | 1 | -7/+9 |
| | | |||||
| * | New agnostic IPv4 IPv6 functions. | Diego Nehab | 2015-08-22 | 1 | -12/+12 |
| | | | | | | 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 | -0/+1 |
| | | | | | Makes initialization code simpler everywhere. | ||||
| * | Fixed timeout bug introduced by commit e81a6ff | Diego Nehab | 2013-09-09 | 1 | -8/+4 |
| | | |||||
| * | Remove warnings and fix makefile for Win32. | Diego Nehab | 2012-12-11 | 1 | -6/+6 |
| | | |||||
| * | Making progress toward a release | Diego Nehab | 2012-04-23 | 1 | -2/+0 |
| | | | | | | | | | | | Documented headers.lua Update copyright date everywhere Remove RCSID from files Move version back to 2.1 rather than 2.1.1 Fixed url package to support ipv6 hosts Changed "domain" to "family" in tcp and udp structures Implemented getfamily methods | ||||
| * | Conditional creation of p_timeout instance 'tm' | Liam Devine | 2012-04-11 | 1 | -0/+4 |
| | | |||||
| * | Compiles with Lua 5.1.4 and Lua 5.2.0-beta, although the makefile needs ↵ | Liam Devine | 2012-04-11 | 1 | -1/+1 |
| | | | | | sorting out to take maybe a version number and also the local paths need removing. | ||||
| * | Preliminary IPv6 support for v2.1 | Diego Nehab | 2012-04-11 | 1 | -1/+1 |
| | | |||||
| * | Saving before big changes to support IPv6. | Diego Nehab | 2011-05-25 | 1 | -4/+10 |
| | | |||||
| * | Decent makefiles! | Diego Nehab | 2009-05-27 | 1 | -1/+1 |
| | | |||||
| * | Crashy bug fixed in recvraw. | Diego Nehab | 2007-06-11 | 1 | -5/+10 |
| | | | | | Also fixed returns on closed socket. | ||||
| * | Before compiling on Windows. | Diego Nehab | 2005-10-07 | 1 | -37/+37 |
| | | |||||
| * | Almost ready to release. | Diego Nehab | 2005-09-29 | 1 | -2/+2 |
| | | |||||
| * | Added check-links-nb.lua that check links in a non-blocking way. | Diego Nehab | 2005-06-20 | 1 | -1/+2 |
| | | |||||
| * | Seems to be working on windows. | Diego Nehab | 2005-03-11 | 1 | -1/+1 |
| | | |||||
| * | Forward server working on Mac OS X... | Diego Nehab | 2005-02-08 | 1 | -1/+1 |
| | | |||||
| * | Simplified use for sock:send. | Diego Nehab | 2005-01-27 | 1 | -2/+2 |
| | | |||||
| * | Almost ready for beta3 | Diego Nehab | 2004-11-27 | 1 | -1/+3 |
| | | |||||
| * | Beta2 is out! Total timeout works on Windows. | Diego Nehab | 2004-07-26 | 1 | -4/+4 |
| | | |||||
| * | Gonna try my luck on windows... | Diego Nehab | 2004-07-26 | 1 | -3/+14 |
| | | |||||
| * | Changed send function. | Diego Nehab | 2004-07-18 | 1 | -11/+12 |
| | | |||||
| * | Still need to fix windows. :o/ | Diego Nehab | 2004-07-15 | 1 | -9/+13 |
| | | |||||
| * | Added getstats. | Diego Nehab | 2004-07-01 | 1 | -0/+14 |
| | | |||||
| * | Moving on to beta2. | Diego Nehab | 2004-07-01 | 1 | -44/+24 |
| | | |||||
| * | Changed the return of the send function... | Diego Nehab | 2004-06-17 | 1 | -2/+10 |
| | | |||||
| * | Manual is almost done. HTTP is missing. | Diego Nehab | 2004-06-15 | 1 | -1/+8 |
| | | | | | | | | Implemented new distribution scheme. Select is now purely C. HTTP reimplemented seems faster dunno why. LTN12 functions that coroutines fail gracefully. | ||||
| * | Previous bug fix caused a new bug. :o/ | Diego Nehab | 2004-05-28 | 1 | -1/+1 |
| | | |||||
| * | Changed receive function. Now uniform with all other functions. Returns nil | Diego Nehab | 2004-03-21 | 1 | -50/+34 |
| | | | | | | | on error, return partial result in the end. http.lua rewritten. | ||||
| * | Worked on the manual. | Diego Nehab | 2004-02-04 | 1 | -1/+2 |
| | | | | | | Implemented stuffing (needs test) Added cddb and qp examples. | ||||
| * | Trying to get connect-with-timeout to work. Darwin works... | Diego Nehab | 2004-01-18 | 1 | -7/+5 |
| | | |||||
| * | Killed a few bugs found by Tomas. | Diego Nehab | 2003-11-27 | 1 | -2/+4 |
| | | |||||
| * | Finished implementation of LuaSocket 2.0 alpha on Linux. | Diego Nehab | 2003-06-26 | 1 | -15/+18 |
| | | | | | Some testing still needed. | ||||
| * | Select re-implemented in a nicer way. | Diego Nehab | 2003-06-09 | 1 | -2/+2 |
| | | | | | | | Few changes in internal class and group registration. Lua modules are compiled and built into library. Dynamic library tested in Linux and Mac OS X. | ||||
| * | Porting to LUA 5.0 final | Diego Nehab | 2003-05-25 | 1 | -184/+91 |
| | | |||||
| * | Closer to release... | Diego Nehab | 2003-03-28 | 1 | -0/+2 |
| | | |||||
| * | Completed port to Lua 5.0-beta. | Diego Nehab | 2003-03-20 | 1 | -5/+5 |
| | | |||||
| * | Faltam testes de ftp e smtp. O resto passa. | Diego Nehab | 2002-12-03 | 1 | -2/+2 |
| | | |||||
| * | Initial revision | Diego Nehab | 2002-03-27 | 1 | -0/+338 |
