diff options
author | chai <chaifix@163.com> | 2018-08-12 21:52:15 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-12 21:52:15 +0800 |
commit | 02298dd5b704e9a87b907e1e7df27decccfd0620 (patch) | |
tree | c55b3b82940e044e3c748dd9107956b61b02d95d /src/lua/net/luaopen_net.cpp | |
parent | 7b34bd98bb00796febd5351b9d2e75fd2c247432 (diff) |
*update
Diffstat (limited to 'src/lua/net/luaopen_net.cpp')
-rw-r--r-- | src/lua/net/luaopen_net.cpp | 6 |
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; } |