mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator
synced 2025-07-06 22:42:19 +08:00
Added check on directory in Local_Storage::file_exists
Added check on directory in Local_Storage::file_exists. Added check in get_filenames_recursive if last char is the path separator (some use cases were adding a path separator even if there were already one). In base.h, added check on s and r, that will avoid an out-of-range vector exception on Visual Studio, same for network.cpp.
This commit is contained in:
@ -379,7 +379,10 @@ unsigned int receive_buffer_amount(sock_t sock)
|
||||
|
||||
static void send_tcp_pending(struct TCP_Socket &socket)
|
||||
{
|
||||
int len = send(socket.sock, &(socket.send_buffer[0]), socket.send_buffer.size(), MSG_NOSIGNAL);
|
||||
size_t buf_size = socket.send_buffer.size();
|
||||
if (buf_size == 0) return;
|
||||
|
||||
int len = send(socket.sock, &(socket.send_buffer[0]), buf_size, MSG_NOSIGNAL);
|
||||
if (len <= 0) return;
|
||||
|
||||
socket.send_buffer.erase(socket.send_buffer.begin(), socket.send_buffer.begin() + len);
|
||||
|
Reference in New Issue
Block a user