Skip to content
Snippets Groups Projects
Commit f2431152 authored by M K's avatar M K Committed by Andy Green
Browse files

Fix compile issue on Apple


Signed-off-by: default avatarM K <mkroehnert42@googlemail.com>
parent a11fe94f
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,9 @@ struct libwebsocket * __libwebsocket_client_connect_2( ...@@ -14,6 +14,9 @@ struct libwebsocket * __libwebsocket_client_connect_2(
int plen = 0; int plen = 0;
char pkt[512]; char pkt[512];
int opt = 1; int opt = 1;
#if defined(__APPLE__)
struct protoent* tcp_proto;
#endif
fprintf(stderr, "__libwebsocket_client_connect_2\n"); fprintf(stderr, "__libwebsocket_client_connect_2\n");
...@@ -62,7 +65,12 @@ struct libwebsocket * __libwebsocket_client_connect_2( ...@@ -62,7 +65,12 @@ struct libwebsocket * __libwebsocket_client_connect_2(
bzero(&server_addr.sin_zero, 8); bzero(&server_addr.sin_zero, 8);
/* Disable Nagle */ /* Disable Nagle */
#if !defined(__APPLE__)
setsockopt(wsi->sock, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt)); setsockopt(wsi->sock, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt));
#else
tcp_proto = getprotobyname("TCP");
setsockopt(wsi->sock, tcp_proto->p_proto, TCP_NODELAY, &opt, sizeof(opt));
#endif
/* Set receiving timeout */ /* Set receiving timeout */
tv.tv_sec = 0; tv.tv_sec = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment