From f6d195138c73aff76c4df0255090e0507aa63a59 Mon Sep 17 00:00:00 2001 From: actboy168 Date: Wed, 3 Apr 2024 16:07:34 +0800 Subject: [PATCH] fixes bug --- binding/lua_socket.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binding/lua_socket.cpp b/binding/lua_socket.cpp index b44c8967..538fc71d 100644 --- a/binding/lua_socket.cpp +++ b/binding/lua_socket.cpp @@ -263,7 +263,7 @@ namespace bee::lua_socket { fd = net::retired_fd; return 1; } - static int mt_tostring(lua_State* L, net::fd_t& fd) { + static int mt_tostring(lua_State* L, net::fd_t fd) { if (fd == net::retired_fd) { lua_pushstring(L, "socket (closed)"); return 1; @@ -343,7 +343,7 @@ namespace bee::lua_socket { luaL_setfuncs(L, lib, 0); lua_setfield(L, -2, "__index"); luaL_Reg mt[] = { - { "__tostring", call_socketref }, + { "__tostring", call_socket }, { "__close", mt_close }, { "__gc", mt_gc }, { NULL, NULL }, @@ -372,7 +372,7 @@ namespace bee::lua_socket { luaL_setfuncs(L, lib, 0); lua_setfield(L, -2, "__index"); luaL_Reg mt[] = { - { "__tostring", call_socketref_no_ownership }, + { "__tostring", call_socket_no_ownership }, { NULL, NULL }, }; luaL_setfuncs(L, mt, 0);