From: Date: Tue, 15 Jan 2008 22:33:52 +0000 (-0500) Subject: Cleanup's for Tim. Also dropping support back to ipv4 only while I find out X-Git-Tag: 0.14~15 X-Git-Url: https://git.m6w6.name/?p=awesomized%2Flibmemcached;a=commitdiff_plain;h=bfa6757d0cf1d00b148007c186d23a18ade06033 Cleanup's for Tim. Also dropping support back to ipv4 only while I find out what broke in IPV6 on OSX. --- diff --git a/THANKS b/THANKS index d5ee9764..a62f3d94 100644 --- a/THANKS +++ b/THANKS @@ -4,3 +4,4 @@ Dustin Sallings - Insight into protocol Tobias Luetke - Performance Feedback Andre Cruz - Help with getting the CRC Hash function to match other connectors Brian Pontz - Hsieh hash +Tim Bunce - Perl Driver work and feedback on API diff --git a/docs/memcached_get.pod b/docs/memcached_get.pod index 2cd7a173..1cf0a60c 100755 --- a/docs/memcached_get.pod +++ b/docs/memcached_get.pod @@ -88,8 +88,8 @@ if you do not pass one to the function. memcached_fetch_execute() is a callback function for result sets. Instead of returning the results to you for processing, it passes each of the result sets to the list of functions you provide. It passes to the function -a memcached_st that can be cloned for use in called the cluster (it can not -be used directly). It also passed a result set which does not need to be freed. +a memcached_st that can be cloned for use in the called function (it can not +be used directly). It also passes a result set which does not need to be freed. Finally it passes a "context". This is just a pointer to a memory reference you supply the calling function. Currently only one value is being passed to each function call. In the future there will be an option to allow this diff --git a/include/memcached.h b/include/memcached.h index bff81a61..605c4a4c 100644 --- a/include/memcached.h +++ b/include/memcached.h @@ -26,14 +26,12 @@ typedef struct memcached_string_st memcached_string_st; typedef struct memcached_server_st memcached_server_st; /* These are Private and should not be used by applications */ -#define SMALL_STRING_LEN 1024 -#define HUGE_STRING_LEN 8196 +#define MEMCACHED_VERSION_STRING_LENGTH 12 -#define MEMCACHED_VERSION_STRING 12 +/* Public defines */ #define MEMCACHED_DEFAULT_PORT 11211 -#define MEMCACHED_DEFAULT_COMMAND_SIZE 350 #define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ -#define MEMCACHED_MAX_BUFFER HUGE_STRING_LEN +#define MEMCACHED_MAX_BUFFER 8196 #define MEMCACHED_MAX_HOST_LENGTH 64 #define MEMCACHED_WHEEL_SIZE 1024 #define MEMCACHED_STRIDE 4 @@ -165,7 +163,7 @@ struct memcached_stat_st { uint64_t evictions; uint64_t bytes_read; uint64_t bytes_written; - char version[MEMCACHED_VERSION_STRING]; + char version[MEMCACHED_VERSION_STRING_LENGTH]; }; struct memcached_string_st { diff --git a/lib/common.h b/lib/common.h index 35775ba8..268109b3 100644 --- a/lib/common.h +++ b/lib/common.h @@ -50,6 +50,10 @@ #include "libmemcached_probes.h" #define MEMCACHED_BLOCK_SIZE 1024 +#define MEMCACHED_DEFAULT_COMMAND_SIZE 350 +#define SMALL_STRING_LEN 1024 +#define HUGE_STRING_LEN 8196 + typedef enum { MEM_NO_BLOCK= (1 << 0), diff --git a/lib/memcached_connect.c b/lib/memcached_connect.c index 278f9da3..d3237fa8 100644 --- a/lib/memcached_connect.c +++ b/lib/memcached_connect.c @@ -10,8 +10,9 @@ static memcached_return set_hostinfo(memcached_server_st *server) sprintf(str_port, "%u", server->port); memset(&hints, 0, sizeof(hints)); + hints.ai_family= AF_INET; hints.ai_socktype= SOCK_STREAM; - hints.ai_protocol= 0; + hints.ai_protocol= IPPROTO_TCP; e= getaddrinfo(server->hostname, str_port, &hints, &ai); if (e != 0) @@ -217,6 +218,7 @@ test_connect: break; default: ptr->cached_errno= errno; + WATCHPOINT_ASSERT(errno == ECONNREFUSED); WATCHPOINT_ERRNO(ptr->cached_errno); close(ptr->hosts[server_key].fd); ptr->hosts[server_key].fd= -1;