summaryrefslogtreecommitdiff
path: root/lib/client-handshake.c
diff options
context:
space:
mode:
authorM K <mkroehnert42@googlemail.com>2011-09-25 10:34:35 +0100
committerAndy Green <andy.green@linaro.org>2011-09-25 10:34:35 +0100
commitf24311527e97d03b21bc06f849f29f6d24fbdb9b (patch)
treeb46a2c728abe43b1913a9a8196d0a13669e01812 /lib/client-handshake.c
parenta11fe94f2cb648fe566aa66251c606b60e7f20b6 (diff)
Fix compile issue on Apple
Signed-off-by: M K <mkroehnert42@googlemail.com>
Diffstat (limited to 'lib/client-handshake.c')
-rw-r--r--lib/client-handshake.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/client-handshake.c b/lib/client-handshake.c
index 346b741..d572b6b 100644
--- a/lib/client-handshake.c
+++ b/lib/client-handshake.c
@@ -14,6 +14,9 @@ struct libwebsocket * __libwebsocket_client_connect_2(
int plen = 0;
char pkt[512];
int opt = 1;
+#if defined(__APPLE__)
+ struct protoent* tcp_proto;
+#endif
fprintf(stderr, "__libwebsocket_client_connect_2\n");
@@ -62,7 +65,12 @@ struct libwebsocket * __libwebsocket_client_connect_2(
bzero(&server_addr.sin_zero, 8);
/* Disable Nagle */
+#if !defined(__APPLE__)
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 */
tv.tv_sec = 0;