memcached_server_add_unix_socket() pushes a single UNIX socket into the
C<memcached_st> structure. This UNIX socket will be placed at the end.
-Duplicate servers are allowed, so duplication is not checked.
+Duplicate servers are allowed, so duplication is not checked. The length
+of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
memcached_server_push() pushes an array of C<memcached_server_st> into
the C<memcached_st> structure. These servers will be placed at the
#define HUGE_STRING_LEN 8196
#define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */
#define MEMCACHED_MAX_BUFFER HUGE_STRING_LEN
+#define MEMCACHED_MAX_HOST_LENGTH 64
typedef enum {
MEMCACHED_SUCCESS,
} memcached_allocated;
struct memcached_server_st {
- char *hostname;
+ char hostname[MEMCACHED_MAX_HOST_LENGTH];
unsigned int port;
int fd;
unsigned int stack_responses;
memcached_connection type)
{
memset(host, 0, sizeof(memcached_server_st));
- host->hostname= strdup(hostname);
+ memcpy(host->hostname, hostname, strlen(hostname));
host->port= port;
host->fd= -1;
host->type= type;
for (x= 0; x < count; x++)
{
- WATCHPOINT_ASSERT(list[x].hostname);
+ WATCHPOINT_ASSERT(list[x].hostname[0] == 0);
host_reset(&ptr->hosts[ptr->number_of_hosts], list[x].hostname,
list[x].port, list[x].type);
ptr->number_of_hosts++;
if (ptr == NULL)
return;
- for (x= 0; x < ptr[0].count; x++)
- free(ptr[x].hostname);
-
free(ptr);
}
Release: 1
License: BSD
Group: System Environment/Libraries
+BuildRequires: gcc-c++
URL: http://tangent.org/552/libmemcached.html
Packager: Jeff Fisher <guppy@techmonkeys.org>