Fix in enum return type (misspelling).
runtime.
* Added the utility memerror to create human readable error strings
from memcached errors (aka convert ints to strings)
+ * Fixed type in MEMCACHED_HOST_LOOKUP_FAILURE
+ * Fixed bug where hostname might not be null terminated
0.9 Thu Nov 15 07:44:00 PST 2007
* fix for when no servers are definied.
typedef enum {
MEMCACHED_SUCCESS,
MEMCACHED_FAILURE,
- MEMCACHED_HOST_LOCKUP_FAILURE,
+ MEMCACHED_HOST_LOOKUP_FAILURE,
MEMCACHED_CONNECTION_FAILURE,
MEMCACHED_CONNECTION_BIND_FAILURE,
MEMCACHED_WRITE_FAILURE,
if ((h= gethostbyname(server->hostname)) == NULL)
{
- return MEMCACHED_HOST_LOCKUP_FAILURE;
+ WATCHPOINT_STRING(server->hostname);
+ WATCHPOINT_STRING(hstrerror(h_errno));
+ return MEMCACHED_HOST_LOOKUP_FAILURE;
}
server->servAddr.sin_family= h->h_addrtype;
rc= unix_socket_connect(ptr, server_key);
break;
}
+
+ if (rc != MEMCACHED_SUCCESS)
+ WATCHPOINT_ERROR(rc);
}
else
{
rc= MEMCACHED_SUCCESS;
if (possible_rc != MEMCACHED_SUCCESS)
+ {
+ WATCHPOINT_ERROR(possible_rc);
rc= MEMCACHED_SOME_ERRORS;
+ }
}
}
LIBMEMCACHED_MEMCACHED_CONNECT_END();
return MEMCACHED_MEMORY_ALLOCATION_FAILURE;
memcpy(new_hostname, hostname, strlen(hostname));
+ new_hostname[strlen(hostname)]= 0;
host_reset(&ptr->hosts[ptr->number_of_hosts], new_hostname, port, type);
ptr->number_of_hosts++;
return "SUCCESS";
case MEMCACHED_FAILURE:
return "FAILURE";
- case MEMCACHED_HOST_LOCKUP_FAILURE:
+ case MEMCACHED_HOST_LOOKUP_FAILURE:
return "HOSTNAME LOOKUP FAILURE";
case MEMCACHED_CONNECTION_FAILURE:
return "CONNECTION FAILURE";