cnping

Minimal Graphical Ping Tool
git clone https://git.sinitax.com/cnlohr/cnping
Log | Files | Refs | Submodules | README | LICENSE | sfeed.txt

commit 3d886a77f7de441dbf3894ebdb1d7bd936cb6dc9
parent e32594ba3332114c47ccee9cd628fe24a59885aa
Author: mrbesen <y.g.2@gmx.de>
Date:   Sat, 21 Jan 2023 12:52:49 +0100

fix http ping for windows

Diffstat:
Mhttping.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/httping.c b/httping.c @@ -18,6 +18,7 @@ #else #include <ws2tcpip.h> #endif + #define SOL_TCP IPPROTO_TCP #else #include <sys/socket.h> #include <netinet/in.h> @@ -98,7 +99,8 @@ reconnect: } int sockVal = 1; - if (setsockopt(httpsock, SOL_TCP, TCP_NODELAY, &sockVal, 4) != 0) + // using char* for sockVal for windows + if (setsockopt(httpsock, SOL_TCP, TCP_NODELAY, (char*) &sockVal, 4) != 0) { ERRM( "Error: Failed to set TCP_NODELAY\n"); // not a critical error, we can continue @@ -113,7 +115,7 @@ reconnect: exit( -1 ); } } -#endif +#endif // not windows /* connect: create a connection with the server */ if (connect(httpsock, (struct sockaddr*)&serveraddr, serveraddr_len) < 0)