<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luasocket/test/utestclnt.lua, branch http-headers-callback</title>
<subtitle>A mirror of https://github.com/lunarmodules/luasocket.git
</subtitle>
<id>https://git.lua4.win/luasocket/atom?h=http-headers-callback</id>
<link rel='self' href='https://git.lua4.win/luasocket/atom?h=http-headers-callback'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/'/>
<updated>2026-07-30T20:06:04+00:00</updated>
<entry>
<title>feat(receive): add maxsize argument to bound memory usage</title>
<updated>2026-07-30T20:06:04+00:00</updated>
<author>
<name>Thijs Schreijer</name>
<email>thijs@thijsschreijer.nl</email>
</author>
<published>2026-07-30T17:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=73b0780321acb14bab6707006f5136ea9998951d'/>
<id>urn:sha1:73b0780321acb14bab6707006f5136ea9998951d</id>
<content type='text'>
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 &lt; 1, #prefix &gt;= maxsize, numeric pattern &gt; 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.
</content>
</entry>
<entry>
<title>refactor: Address issues raised by linter</title>
<updated>2022-03-19T14:13:15+00:00</updated>
<author>
<name>Thijs Schreijer</name>
<email>thijs@thijsschreijer.nl</email>
</author>
<published>2022-03-18T11:12:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=601ad8d59f11d7180015d0ecfb9d0a8d67f6f5c1'/>
<id>urn:sha1:601ad8d59f11d7180015d0ecfb9d0a8d67f6f5c1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Unix domain tests still broken.</title>
<updated>2013-05-30T09:59:28+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego@impa.br</email>
</author>
<published>2013-05-30T09:59:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=ebde49944b1ba06153fe31a1ad92aaebf6e053e2'/>
<id>urn:sha1:ebde49944b1ba06153fe31a1ad92aaebf6e053e2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove uses of arg in the codebase</title>
<updated>2013-01-23T18:13:32+00:00</updated>
<author>
<name>Pierre Chapuis</name>
<email>catwell@archlinux.us</email>
</author>
<published>2013-01-23T18:13:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=33b4f0cfc7f0a0ebd5d4aaf9bbfe88a02d4368e7'/>
<id>urn:sha1:33b4f0cfc7f0a0ebd5d4aaf9bbfe88a02d4368e7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Saving before big changes to support IPv6.</title>
<updated>2011-05-25T20:57:22+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego@tecgraf.puc-rio.br</email>
</author>
<published>2011-05-25T20:57:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=3a8ba90dfb0c2eb224f317dd692ede426691e72a'/>
<id>urn:sha1:3a8ba90dfb0c2eb224f317dd692ede426691e72a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Forward server working on Mac OS X...</title>
<updated>2005-02-08T10:01:01+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego@tecgraf.puc-rio.br</email>
</author>
<published>2005-02-08T10:01:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=8d4e240f6ae50d9b22ddc44f5e207018935da907'/>
<id>urn:sha1:8d4e240f6ae50d9b22ddc44f5e207018935da907</id>
<content type='text'>
</content>
</entry>
</feed>
