projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Indention fix.
[awesomized/libmemcached]
/
clients
/
ms_conn.c
diff --git
a/clients/ms_conn.c
b/clients/ms_conn.c
index 9f92d423c1796093072662d0120ba4cd684af3e3..005879bdaaed7a994df109a7493fe82565a3fe0c 100644
(file)
--- a/
clients/ms_conn.c
+++ b/
clients/ms_conn.c
@@
-797,7
+797,11
@@
static int ms_network_connect(ms_conn_t *c,
* that otherwise mess things up.
*/
memset(&hints, 0, sizeof(hints));
* that otherwise mess things up.
*/
memset(&hints, 0, sizeof(hints));
+#ifdef AI_ADDRCONFIG
hints.ai_flags= AI_PASSIVE | AI_ADDRCONFIG;
hints.ai_flags= AI_PASSIVE | AI_ADDRCONFIG;
+#else
++ hints.ai_flags= AI_PASSIVE;
+#endif /* AI_ADDRCONFIG */
if (is_udp)
{
hints.ai_protocol= IPPROTO_UDP;
if (is_udp)
{
hints.ai_protocol= IPPROTO_UDP;
@@
-2752,18
+2756,18
@@
static uint32_t ms_get_rep_sock_index(ms_conn_t *c, int cmd)
if (i == ms_setting.rep_write_srv)
{
/* random get one replication server to read */
if (i == ms_setting.rep_write_srv)
{
/* random get one replication server to read */
- sock_index= (uint32_t)
(random() % c->total_sfds)
;
+ sock_index= (uint32_t)
random() % c->total_sfds
;
}
else
{
/* random get one replication writing server to write */
}
else
{
/* random get one replication writing server to write */
- sock_index= (uint32_t)
(random() % ms_setting.rep_write_srv)
;
+ sock_index= (uint32_t)
random() % ms_setting.rep_write_srv
;
}
}
else if (cmd == CMD_GET)
{
/* random get one replication server to read */
}
}
else if (cmd == CMD_GET)
{
/* random get one replication server to read */
- sock_index= (uint32_t)
(random() % c->total_sfds)
;
+ sock_index= (uint32_t)
random() % c->total_sfds
;
}
}
while (c->tcpsfd[sock_index] == 0);
}
}
while (c->tcpsfd[sock_index] == 0);