aboutsummaryrefslogtreecommitdiff
path: root/src/lua/net/luaopen_net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/net/luaopen_net.cpp')
-rw-r--r--src/lua/net/luaopen_net.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lua/net/luaopen_net.cpp b/src/lua/net/luaopen_net.cpp
index 4bbb7e8..e2b9a9a 100644
--- a/src/lua/net/luaopen_net.cpp
+++ b/src/lua/net/luaopen_net.cpp
@@ -47,9 +47,9 @@ namespace lua
// type, address, port
else if (luax_gettop(L) == 3)
{
- if (luax_isstring(L, 2))
+ if (luax_isstringstrict(L, 2))
info.address = tk_strtohl(luax_checkstring(L, 2));
- else if(luax_isinteger(L, 2))
+ else if(luax_isintegerstrict(L, 2))
info.address = luax_checkinteger(L, 2);
info.port = luax_checkinteger(L, 3);
}
@@ -64,7 +64,7 @@ namespace lua
{
int size = luax_checkinteger(L, 1);
Proxy* proxy = (Proxy*)luax_newinstance(L, JIN_NETWORK_BUFFER, sizeof(Proxy));
- net::Buffer* buffer = new net::Buffer();
+ net::Buffer* buffer = new net::Buffer(size);
proxy->bind(buffer, JIN_NETWORK_BUFFER);
return 1;
}