Skip to content

Commit

Permalink
Fixed Issues With Windows & Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLimiteds committed Sep 26, 2024
1 parent 7b0a300 commit ee1ebf7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/GabHttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#ifdef _WIN32
#include <windows.h>
#else
#include <sys/types.h>
#endif


Expand Down Expand Up @@ -98,7 +100,12 @@ namespace GabHttp {
char client_ip[INET_ADDRSTRLEN];
inet_ntop(AF_INET, & client_addr.sin_addr, client_ip, INET_ADDRSTRLEN);

SSIZE_T bytes_read = recv(client_socket, buffer.data(), buffer.size() - 1, 0);
#ifdef _WIN32
int bytes_read = recv(client_socket, buffer.data(), buffer.size() -1 , 0);
#else
ssize_t bytes_read = recv(client_socket, buffer.data(), buffer.size() - 1, 0);
#endif

if (bytes_read <= 0) {
#ifdef _WIN32
closesocket(static_cast < SOCKET > (client_socket));
Expand Down

0 comments on commit ee1ebf7

Please sign in to comment.