<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luasocket/test/testclnt.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-08-31T06:26:32+00:00</updated>
<entry>
<title>chore(test): add 2 tests reusing partial results</title>
<updated>2026-08-31T06:26:32+00:00</updated>
<author>
<name>Thijs Schreijer</name>
<email>thijs@thijsschreijer.nl</email>
</author>
<published>2026-08-31T06:26:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=4863f32b358a8d533f629084a86fb4932ebbd2f3'/>
<id>urn:sha1:4863f32b358a8d533f629084a86fb4932ebbd2f3</id>
<content type='text'>
Tests to show the socket isn't left in an undetermined state due
to dataloss, since the partial results are returned to the user.
</content>
</entry>
<entry>
<title>fix(receive): guard numeric pattern against size_t overflow on cast</title>
<updated>2026-08-29T15:22:41+00:00</updated>
<author>
<name>Thijs Schreijer</name>
<email>thijs@thijsschreijer.nl</email>
</author>
<published>2026-08-29T15:19:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=827ae20771d34912a8f79b50dc68e6430945b9eb'/>
<id>urn:sha1:827ae20771d34912a8f79b50dc68e6430945b9eb</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>fix(receive): guard maxsize against size_t overflow on cast</title>
<updated>2026-08-29T15:22:29+00:00</updated>
<author>
<name>Thijs Schreijer</name>
<email>thijs@thijsschreijer.nl</email>
</author>
<published>2026-08-29T15:09:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=8cbbce56e64c84b53593c815f6dcdd9214897b74'/>
<id>urn:sha1:8cbbce56e64c84b53593c815f6dcdd9214897b74</id>
<content type='text'>
Casting a double larger than SIZE_MAX to size_t is undefined
behavior; bound-check maxsize before the cast.
</content>
</entry>
<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>Changed buffer-per-socket to buffer-per-operation.</title>
<updated>2015-10-06T03:33:50+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego.nehab@gmail.com</email>
</author>
<published>2015-10-06T03:33:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=be67f63f4e11e53690bf1431a236f86b484c9bf0'/>
<id>urn:sha1:be67f63f4e11e53690bf1431a236f86b484c9bf0</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Fixes suggested by @Florob in #147.</title>
<updated>2015-08-25T18:41:40+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego.nehab@gmail.com</email>
</author>
<published>2015-08-25T18:41:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=77bba625d7aaa0f9e118879163687fcbcb0b5a7b'/>
<id>urn:sha1:77bba625d7aaa0f9e118879163687fcbcb0b5a7b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>New agnostic IPv4 IPv6 functions.</title>
<updated>2015-08-22T22:52:01+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego@impa.br</email>
</author>
<published>2015-08-22T22:52:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=96965b179c7311f850f72a8629b9ba6d3a31d117'/>
<id>urn:sha1:96965b179c7311f850f72a8629b9ba6d3a31d117</id>
<content type='text'>
Also dealing with EPROTOTYPE Yosemite seems to be throwing
at us for no reason.
</content>
</entry>
<entry>
<title>New compat.h module implements luaL_setfuncs.</title>
<updated>2015-08-21T18:39:34+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego.nehab@gmail.com</email>
</author>
<published>2015-08-21T18:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed'/>
<id>urn:sha1:e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed</id>
<content type='text'>
Makes initialization code simpler everywhere.
</content>
</entry>
<entry>
<title>Fix. Optional IPv6 test</title>
<updated>2013-05-27T07:26:35+00:00</updated>
<author>
<name>moteus</name>
<email>mimir@newmail.ru</email>
</author>
<published>2013-05-27T07:26:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=bd51d8c1a5bb30e6a358dee6e85963f777edfff4'/>
<id>urn:sha1:bd51d8c1a5bb30e6a358dee6e85963f777edfff4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Test server exits gracefully at command of test client</title>
<updated>2012-05-01T08:21:06+00:00</updated>
<author>
<name>Diego Nehab</name>
<email>diego.nehab@gmail.com</email>
</author>
<published>2012-05-01T08:21:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/luasocket/commit/?id=04be61f88df2277fd0d2010b2deb851d9b081923'/>
<id>urn:sha1:04be61f88df2277fd0d2010b2deb851d9b081923</id>
<content type='text'>
</content>
</entry>
</feed>
