This commit is contained in:
MihailRis 2025-09-28 22:22:59 +03:00
parent 2d1c69ee7e
commit 6eda819011
3 changed files with 4 additions and 4 deletions

View File

@ -33,8 +33,7 @@ static int l_tostring(lua::State* L) {
lua::pop(L);
return lua::pushlstring(L, buffer.data(), size);
} else {
lua::bytearray_as_string(L, 1);
return 1;
return lua::pushlstring(L, lua::bytearray_as_string(L, 1));
}
}

View File

@ -773,7 +773,7 @@ namespace lua {
lua::pushvalue(L, -2);
lua::call(L, 1, 1);
auto view = lua::tolstring(L, -1);
lua::pop(L);
lua::pop(L, 2);
return view;
}
}

View File

@ -696,7 +696,8 @@ public:
while (open) {
int size = recv(descriptor, buffer.data(), buffer.size(), 0);
if (size <= 0) {
logger.error() <<id <<"udp connection " << id << handle_socket_error(" recv error").what();
logger.error() << "udp connection " << id
<< handle_socket_error(" recv error").what();
if (!open) break;
closesocket(descriptor);
state = ConnectionState::CLOSED;