X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Futilities.cc;h=158890515ef43840bc9d49409e386bb0706ed980;hb=0b262a1571e2196e988a841d3449b5a4e0a2081a;hp=4dfc15bbc80f9a66a9e9e8ae7d54f597136e169c;hpb=956d15b5b1f3f3518eb374a3a9e0393e9dacd3b6;p=awesomized%2Flibmemcached diff --git a/clients/utilities.cc b/clients/utilities.cc index 4dfc15bb..15889051 100644 --- a/clients/utilities.cc +++ b/clients/utilities.cc @@ -1,4 +1,5 @@ /* LibMemcached + * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * @@ -8,11 +9,12 @@ * Summary: * */ -#include +#include #include #include +#include #include #include #include @@ -97,14 +99,17 @@ static const char *lookup_help(memcached_options option) case OPT_BINARY: return("Switch to binary protocol."); case OPT_ANALYZE: return("Analyze the provided servers."); case OPT_UDP: return("Use UDP protocol when communicating with server."); + case OPT_BUFFER: return("Enable request buffering."); case OPT_USERNAME: return "Username to use for SASL authentication"; case OPT_PASSWD: return "Password to use for SASL authentication"; case OPT_FILE: return "Path to file in which to save result"; case OPT_STAT_ARGS: return "Argument for statistics"; - default: WATCHPOINT_ASSERT(0); + case OPT_SERVER_VERSION: return "Memcached daemon software version"; + default: + break; }; - WATCHPOINT_ASSERT(0); + assert(0); return "forgot to document this function :)"; } @@ -143,15 +148,25 @@ void process_hash_option(memcached_st *memc, char *opt_hash) set= MEMCACHED_HASH_DEFAULT; /* Just here to solve warning */ if (!strcasecmp(opt_hash, "CRC")) + { set= MEMCACHED_HASH_CRC; + } else if (!strcasecmp(opt_hash, "FNV1_64")) + { set= MEMCACHED_HASH_FNV1_64; + } else if (!strcasecmp(opt_hash, "FNV1A_64")) + { set= MEMCACHED_HASH_FNV1A_64; + } else if (!strcasecmp(opt_hash, "FNV1_32")) + { set= MEMCACHED_HASH_FNV1_32; + } else if (!strcasecmp(opt_hash, "FNV1A_32")) + { set= MEMCACHED_HASH_FNV1A_32; + } else { fprintf(stderr, "hash: type not recognized %s\n", opt_hash); @@ -169,12 +184,12 @@ void process_hash_option(memcached_st *memc, char *opt_hash) void initialize_sockets(void) { /* Define the function for all platforms to avoid #ifdefs in each program */ -#if defined(WIN32) && WIN32 +#if defined(_WIN32) WSADATA wsaData; if (WSAStartup(MAKEWORD(2,0), &wsaData) != 0) { fprintf(stderr, "Socket Initialization Error. Program aborted\n"); exit(EXIT_FAILURE); } -#endif +#endif // #if defined(_WIN32) }