Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
3a547b8e
Commit
3a547b8e
authored
Dec 13, 2018
by
Mark Nunberg
Browse files
Unix: set addrlen so async reconnect uses proper size
parent
f51363a7
Changes
1
Show whitespace changes
Inline
Side-by-side
net.c
View file @
3a547b8e
...
@@ -502,7 +502,8 @@ int redisContextConnectUnix(redisContext *c, const char *path, const struct time
...
@@ -502,7 +502,8 @@ int redisContextConnectUnix(redisContext *c, const char *path, const struct time
sa
=
(
struct
sockaddr_un
*
)(
c
->
saddr
=
malloc
(
sizeof
(
struct
sockaddr_un
)));
sa
=
(
struct
sockaddr_un
*
)(
c
->
saddr
=
malloc
(
sizeof
(
struct
sockaddr_un
)));
c
->
addrlen
=
sizeof
(
struct
sockaddr_un
);
c
->
addrlen
=
sizeof
(
struct
sockaddr_un
);
sa
->
sun_family
=
AF_UNIX
;
sa
->
sun_family
=
AF_UNIX
;
strncpy
(
sa
->
sun_path
,
path
,
sizeof
(
sa
->
sun_path
)
-
1
);
c
->
addrlen
=
sizeof
(
*
sa
);
strncpy
(
sa
->
sun_path
,
path
,
sizeof
(
sa
->
sun_path
)
-
1
);
if
(
connect
(
c
->
fd
,
(
struct
sockaddr
*
)
sa
,
sizeof
(
*
sa
))
==
-
1
)
{
if
(
connect
(
c
->
fd
,
(
struct
sockaddr
*
)
sa
,
sizeof
(
*
sa
))
==
-
1
)
{
if
(
errno
==
EINPROGRESS
&&
!
blocking
)
{
if
(
errno
==
EINPROGRESS
&&
!
blocking
)
{
/* This is ok. */
/* This is ok. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment