From 98b03ab256458a7a447a2564535a4f0bb661c4a5 Mon Sep 17 00:00:00 2001 From: actboy168 Date: Wed, 3 Apr 2024 16:11:35 +0800 Subject: [PATCH] Revert "fixes bug" This reverts commit f6d195138c73aff76c4df0255090e0507aa63a59. --- 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 538fc71d..b44c8967 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_socket }, + { "__tostring", call_socketref }, { "__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_socket_no_ownership }, + { "__tostring", call_socketref_no_ownership }, { NULL, NULL }, }; luaL_setfuncs(L, mt, 0);