Skip to content

Commit

Permalink
Shot in the dark fix for TCP_KEEPALIVE in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-grunder committed Oct 26, 2017
1 parent 010336d commit 51e4872
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
15 changes: 10 additions & 5 deletions library.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "common.h"
#include "php_network.h"
#include <sys/types.h>
#ifndef _MSC_VER
#include <netinet/tcp.h> /* TCP_NODELAY */
#include <sys/socket.h>
#endif

#ifdef HAVE_REDIS_IGBINARY
#include "igbinary/igbinary.h"
#endif

#ifdef HAVE_REDIS_LZF
#include <lzf.h>
#endif

#include <zend_exceptions.h>
#include "php_redis.h"
#include "library.h"
Expand All @@ -29,7 +29,12 @@
#define SCORE_DECODE_INT 1
#define SCORE_DECODE_DOUBLE 2

#ifdef PHP_WIN32
#ifndef PHP_WIN32
#include <netinet/tcp.h> /* TCP_NODELAY */
#include <sys/socket.h> /* SO_KEEPALIVE */
#else
#include <winsock.h>

# if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION <= 4
/* This proto is available from 5.5 on only */
PHP_REDIS_API int usleep(unsigned int useconds);
Expand Down
7 changes: 6 additions & 1 deletion redis_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
#include "redis_commands.h"

#include "php_network.h"
#include <netinet/tcp.h> /* TCP_KEEPALIVE */

#ifndef PHP_WIN32
#include <netinet/tcp.h> /* TCP_KEEPALIVE */
#else
#include <winsock.h>
#endif

#include <zend_exceptions.h>

Expand Down

0 comments on commit 51e4872

Please sign in to comment.