mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 21:11:50 +00:00
fix random fatal error in socket:recv
This commit is contained in:
parent
dbd27d4423
commit
2fa78b7b21
1 changed files with 2 additions and 1 deletions
|
|
@ -101,7 +101,8 @@ static int l_recv(lua::State* L) {
|
||||||
if (connection == nullptr) {
|
if (connection == nullptr) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
util::Buffer<char> buffer(glm::min(length, connection->available()));
|
length = glm::min(length, connection->available());
|
||||||
|
util::Buffer<char> buffer(length);
|
||||||
|
|
||||||
int size = connection->recv(buffer.data(), length);
|
int size = connection->recv(buffer.data(), length);
|
||||||
if (size == -1) {
|
if (size == -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue