From bdedf5922c80a8dfd3e7ea73c57295db72583f50 Mon Sep 17 00:00:00 2001 From: Gennady Feldman Date: Wed, 25 Feb 2015 11:58:32 -0500 Subject: [PATCH] Adding #ifdef HAVE_NETINET_IN_H around the new TCP_NODELAY code to fix compilation on Windows and possibly others. --- stomp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stomp.c b/stomp.c index b9dab3e..5dfd731 100644 --- a/stomp.c +++ b/stomp.c @@ -26,8 +26,9 @@ #include "ext/standard/php_smart_str.h" #include "stomp.h" #include "php_stomp.h" +#ifdef HAVE_NETINET_IN_H #include - +#endif #define RETURN_READ_FRAME_FAIL { stomp_free_frame(f); return NULL; } ZEND_EXTERN_MODULE_GLOBALS(stomp); @@ -222,7 +223,9 @@ int stomp_connect(stomp_t *stomp, const char *host, unsigned short port TSRMLS_D return 0; } +#ifdef HAVE_NETINET_IN_H setsockopt(stomp->fd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)); +#endif size = sizeof(stomp->localaddr); memset(&stomp->localaddr, 0, size);