Created
February 7, 2012 22:57
-
-
Save rem7/1762716 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -230,7 +230,12 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct t | |
sa.sin_family = AF_INET; | |
sa.sin_port = htons(port); | |
- if (inet_pton(AF_INET, addr, &sa.sin_addr) == 0) { | |
+ | |
+ // Windows XP does not support inet_pton so using | |
+ // inet_addr instead. | |
+ sa.sin_addr.S_un.S_addr = inet_addr(addr); | |
+ if( sa.sin_addr.S_un.S_addr == INADDR_ANY || sa.sin_addr.S_un.S_addr == INADDR_NONE) { | |
+ // if (inet_pton(AF_INET, addr, &sa.sin_addr) == 0) { | |
struct hostent *he; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment