* Explicitly call gai_strerrorA (for Windows builds), so that the code work correctly in 32bit or 64bit builds.
* Implement GAI_STRERROR macro to deal with Windows vs. Non-Windows compiles for 64-bit.
* make usocket.c consistent with other modules that call macro GAI_STRERROR
* Use different name not just different case for macro wrapping function
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
This makes it so that a listening socket does not become readable for
accept() until a connection has been fully established *and* started
sending something, thus the program doesn't have to wait for the first
data. This only makes sense for client-speaks-first protocols.
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
If a source is specified without a content-length header, LuaSocket
sends the data in the chunked transfer coding; however, it doesn't set
the transfer-encoding header. While I recognize that the user can set
this manually, this is a gotcha that has caught me multiple times.
RFC7230, section 3.3.3
(https://tools.ietf.org/html/rfc7230#section-3.3.3)
is clear about this; if neither content-length nor transfer-encoding
chunked are specified, the request message body length is zero. While
some servers may ignore this, I have encountered several that follow
the RFC in this regard, most recently golang's net/http.
Some systems like Mac OS X 10.5 (and lower) do not have EAI_OVERFLOW and
AI_NUMERICSERV defined.
These variables are used to avoid a potentially slow name resolution
for the hostname (which will always be an ip address)
and for service name (which will always be an actual port number).
The code might be slower, but it should still work.
Closes: #242