mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-13 06:04:31 +02:00
Compare commits
10 Commits
hjelmeland
...
c7bf457ba7
Author | SHA1 | Date | |
---|---|---|---|
c7bf457ba7 | |||
de359ea408 | |||
c93f9154e1 | |||
8a5368b659 | |||
22b8202d70 | |||
3a817a56eb | |||
7eaf648056 | |||
bef62aeb50 | |||
e1651c9d8b | |||
610bea9c0f |
@ -89,7 +89,7 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the
|
|||||||
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
|
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
|
||||||
> socket = require("socket")
|
> socket = require("socket")
|
||||||
> print(socket._VERSION)
|
> print(socket._VERSION)
|
||||||
--> LuaSocket 3.0.0
|
--> LuaSocket 3.1.0
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p> Each module loads their dependencies automatically, so you only need to
|
<p> Each module loads their dependencies automatically, so you only need to
|
||||||
|
@ -69,6 +69,7 @@ local function make_plat(plat)
|
|||||||
["socket.smtp"] = "src/smtp.lua",
|
["socket.smtp"] = "src/smtp.lua",
|
||||||
ltn12 = "src/ltn12.lua",
|
ltn12 = "src/ltn12.lua",
|
||||||
socket = "src/socket.lua",
|
socket = "src/socket.lua",
|
||||||
|
mbox = "src/mbox.lua",
|
||||||
mime = "src/mime.lua"
|
mime = "src/mime.lua"
|
||||||
}
|
}
|
||||||
if plat == "unix"
|
if plat == "unix"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Distribution makefile
|
# Distribution makefile
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
DIST = luasocket-3.0.0
|
DIST = luasocket-3.1.0
|
||||||
|
|
||||||
TEST = \
|
TEST = \
|
||||||
test/README \
|
test/README \
|
||||||
|
@ -290,7 +290,7 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
lua_pushstring(L, name);
|
lua_pushstring(L, name);
|
||||||
lua_pushstring(L, port);
|
lua_pushinteger(L, (int) strtol(port, (char **) NULL, 10));
|
||||||
switch (family) {
|
switch (family) {
|
||||||
case AF_INET: lua_pushliteral(L, "inet"); break;
|
case AF_INET: lua_pushliteral(L, "inet"); break;
|
||||||
case AF_INET6: lua_pushliteral(L, "inet6"); break;
|
case AF_INET6: lua_pushliteral(L, "inet6"); break;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
/*-------------------------------------------------------------------------* \
|
/*-------------------------------------------------------------------------* \
|
||||||
* Current socket library version
|
* Current socket library version
|
||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
#define LUASOCKET_VERSION "LuaSocket 3.0.0"
|
#define LUASOCKET_VERSION "LuaSocket 3.1.0"
|
||||||
#define LUASOCKET_COPYRIGHT "Copyright (C) 1999-2013 Diego Nehab"
|
#define LUASOCKET_COPYRIGHT "Copyright (C) 1999-2013 Diego Nehab"
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*\
|
/*-------------------------------------------------------------------------*\
|
||||||
|
@ -272,7 +272,7 @@ SOCKET_win64=wsocket.obj
|
|||||||
#
|
#
|
||||||
SO=$(SO_$(PLAT))
|
SO=$(SO_$(PLAT))
|
||||||
O=$(O_$(PLAT))
|
O=$(O_$(PLAT))
|
||||||
SOCKET_V=3.0.0
|
SOCKET_V=3.1.0
|
||||||
MIME_V=1.0.3
|
MIME_V=1.0.3
|
||||||
SOCKET_SO=socket-$(SOCKET_V).$(SO)
|
SOCKET_SO=socket-$(SOCKET_V).$(SO)
|
||||||
MIME_SO=mime-$(MIME_V).$(SO)
|
MIME_SO=mime-$(MIME_V).$(SO)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#define PIE_CONNREFUSED "connection refused"
|
#define PIE_CONNREFUSED "connection refused"
|
||||||
#define PIE_CONNABORTED "closed"
|
#define PIE_CONNABORTED "closed"
|
||||||
#define PIE_CONNRESET "closed"
|
#define PIE_CONNRESET "closed"
|
||||||
#define PIE_TIMEDOUT "connection timeout"
|
#define PIE_TIMEDOUT "timeout"
|
||||||
#define PIE_AGAIN "temporary failure in name resolution"
|
#define PIE_AGAIN "temporary failure in name resolution"
|
||||||
#define PIE_BADFLAGS "invalid value for ai_flags"
|
#define PIE_BADFLAGS "invalid value for ai_flags"
|
||||||
#define PIE_BADHINTS "invalid value for hints"
|
#define PIE_BADHINTS "invalid value for hints"
|
||||||
|
@ -152,7 +152,7 @@ function _M.parse(url, default)
|
|||||||
url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
|
url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
|
||||||
function(s) parsed.scheme = s; return "" end)
|
function(s) parsed.scheme = s; return "" end)
|
||||||
-- get authority
|
-- get authority
|
||||||
url = string.gsub(url, "^//([^/]*)", function(n)
|
url = string.gsub(url, "^//([^/%?#]*)", function(n)
|
||||||
parsed.authority = n
|
parsed.authority = n
|
||||||
return ""
|
return ""
|
||||||
end)
|
end)
|
||||||
|
@ -262,6 +262,7 @@ int socket_recv(p_socket ps, char *data, size_t count, size_t *got,
|
|||||||
if (err != WSAEWOULDBLOCK) {
|
if (err != WSAEWOULDBLOCK) {
|
||||||
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
||||||
prev = err;
|
prev = err;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
||||||
}
|
}
|
||||||
@ -291,6 +292,7 @@ int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got,
|
|||||||
if (err != WSAEWOULDBLOCK) {
|
if (err != WSAEWOULDBLOCK) {
|
||||||
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
||||||
prev = err;
|
prev = err;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
typedef int socklen_t;
|
|
||||||
typedef SOCKADDR_STORAGE t_sockaddr_storage;
|
typedef SOCKADDR_STORAGE t_sockaddr_storage;
|
||||||
typedef SOCKET t_socket;
|
typedef SOCKET t_socket;
|
||||||
typedef t_socket *p_socket;
|
typedef t_socket *p_socket;
|
||||||
|
Reference in New Issue
Block a user