Commit Graph

21 Commits

Author SHA1 Message Date
Pieter Noordhuis
7bc9f54134 Merge pull request #47 from geoffgarside/addrinfo
Use getaddrinfo
2011-07-20 05:02:08 -07:00
Pieter Noordhuis
b3290392d9 Put back missing socket error check after select(2) 2011-07-10 17:51:48 +02:00
Pieter Noordhuis
e6d997a96f Extract function to check a socket for errors 2011-06-27 23:42:18 +02:00
Geoff Garside
c4ed06d90c Fix incorrect "no route to host" errors.
If getaddrinfo(3) includes an AF_INET6 address before an AF_INET
address on a host with only IPv4 network connectivity then the
redisContextConnectTcp call would fail with "no route to host".

This commit fixes this issue by specifically handling the errno
EHOSTUNREACH error and entering another iteration of the addrinfo
loop. This will allow following AF_INET addresses to be attempted.
2011-06-18 14:08:25 +01:00
Geoff Garside
3afe2585de Use getaddrinfo(3) in redisContextConnectTcp.
Change redisContextConnectTcp() function to use getaddrinfo(3) to
perform address resolution, socket creation and connection. Resolved
addresses are limited to those reachable by the AF_INET family.
2011-06-17 19:26:46 +01:00
Geoff Garside
b4664b41c7 Add redisSetReuseAddr(c, fd) static function.
Extract setting SO_REUSEADDR socket option into separate function
so the same code can be more easily used by redisCreateSocket and
other functions.
2011-06-17 17:41:28 +01:00
Pieter Noordhuis
0cb7c27d9c Update license 2011-04-21 22:46:23 +02:00
Pieter Noordhuis
0ee7c66818 Use static buffer for error string on context 2011-04-21 15:56:22 +02:00
Pieter Noordhuis
36f73fdb0c Fix copying timeval for timeout 2011-02-04 16:46:05 +01:00
Pieter Noordhuis
2fc0d8756e Use select(2) for enforce a timeout on blocking connect(2) 2011-02-04 15:26:28 +01:00
Pieter Noordhuis
43ab0f8018 Return error on socket timeout for a blocking context 2011-01-07 13:04:42 +01:00
Pieter Noordhuis
a020db3013 License 2010-12-29 15:52:07 +01:00
Pieter Noordhuis
7e4ce57367 Solaris doesn't know AF_LOCAL 2010-12-16 22:59:07 +01:00
Pieter Noordhuis
a1e2c6dfed Add myself to license in some files 2010-12-16 22:08:46 +01:00
Pieter Noordhuis
2635feb0ac Wait with setting CONNECTED until there is an fd 2010-12-01 12:54:47 +01:00
Pieter Noordhuis
b6b96f776e Make error messages consistent in casing 2010-11-22 10:37:14 +01:00
Pieter Noordhuis
0ccb2c8d89 Add functiont to net.c to connect to a unix socket 2010-11-03 11:31:33 +01:00
Pieter Noordhuis
8220cd4ba6 Move code in net.c to separate functions 2010-11-03 11:08:24 +01:00
Pieter Noordhuis
e51ddd7c2c Make setError receive an sds 2010-11-02 17:14:03 +01:00
Pieter Noordhuis
b8b296654d Strip net.c down to the bare minimum 2010-11-02 17:09:26 +01:00
Pieter Noordhuis
dd8a34de84 Move anet.{c,h} to net.{c,h} 2010-11-02 16:44:44 +01:00