X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fmemrm.cc;fp=clients%2Fmemrm.cc;h=0551e326755969ff714f30ba1916be6bf0f12a74;hb=b77f874c7d7ff386d01eeedb44c14d3003354bae;hp=d4d93c2e9c2621e80b3bc56613889f715802f231;hpb=d61195ed2a8d1db91773e1b66f6a17372f3a4838;p=awesomized%2Flibmemcached diff --git a/clients/memrm.cc b/clients/memrm.cc index d4d93c2e..0551e326 100644 --- a/clients/memrm.cc +++ b/clients/memrm.cc @@ -10,11 +10,13 @@ */ #include "config.h" -#include -#include +#include +#include #include +#include +#include + #include -#include #include "client_options.h" #include "utilities.h" @@ -43,7 +45,7 @@ int main(int argc, char *argv[]) options_parse(argc, argv); initialize_sockets(); - if (!opt_servers) + if (opt_servers == 0) { char *temp; @@ -65,8 +67,18 @@ int main(int argc, char *argv[]) memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, (uint64_t) opt_binary); - if (!initialize_sasl(memc, opt_username, opt_passwd)) + if (opt_username and LIBMEMCACHED_WITH_SASL_SUPPORT == 0) + { + memcached_free(memc); + std::cerr << "--username was supplied, but binary was not built with SASL support." << std::endl; + return EXIT_FAILURE; + } + + + if (opt_username and initialize_sasl(memc, opt_username, opt_passwd) == false) { + std::cerr << "Failed to initialize SASL support." << std::endl; + memcached_free(memc); return EXIT_FAILURE; }