projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
9bcd450
)
Add option to use UDS with server list.
author
Brian Aker
<brian@tangent.org>
Thu, 24 Mar 2011 23:06:37 +0000
(16:06 -0700)
committer
Brian Aker
<brian@tangent.org>
Thu, 24 Mar 2011 23:06:37 +0000
(16:06 -0700)
libmemcached/server_list.c
patch
|
blob
|
history
diff --git
a/libmemcached/server_list.c
b/libmemcached/server_list.c
index 64b8b0c4c83ed101c0cdac2198f8863dccb882a1..ca37f7f9a4b3f159e5f8747d50be33c4918a3698 100644
(file)
--- a/
libmemcached/server_list.c
+++ b/
libmemcached/server_list.c
@@
-24,7
+24,9
@@
memcached_server_list_append_with_weight(memcached_server_list_st ptr,
if (hostname == NULL || error == NULL)
return NULL;
if (hostname == NULL || error == NULL)
return NULL;
- if (! port)
+ if (hostname[0] == '/')
+ port = 0;
+ else if (! port)
port= MEMCACHED_DEFAULT_PORT;
/* Increment count for hosts */
port= MEMCACHED_DEFAULT_PORT;
/* Increment count for hosts */
@@
-43,7
+45,7
@@
memcached_server_list_append_with_weight(memcached_server_list_st ptr,
}
/* @todo Check return type */
}
/* @todo Check return type */
- memcached_server_create_with(NULL, &new_host_list[count-1], hostname, port, weight,
MEMCACHED_CONNECTION_TCP
);
+ memcached_server_create_with(NULL, &new_host_list[count-1], hostname, port, weight,
port ? MEMCACHED_CONNECTION_TCP : MEMCACHED_CONNECTION_UNIX_SOCKET
);
// Handset allocated since
new_host_list->options.is_allocated= true;
// Handset allocated since
new_host_list->options.is_allocated= true;