X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fmemcat.cc;h=3e073650345750b35b3325855f1b4fe63af77fca;hb=3dffdabbb7e41075f7998cd2af6498b42c97f471;hp=fdbcb67ea5180edee241bfe378aa2235dbf3ca0c;hpb=b77f874c7d7ff386d01eeedb44c14d3003354bae;p=awesomized%2Flibmemcached diff --git a/clients/memcat.cc b/clients/memcat.cc index fdbcb67e..3e073650 100644 --- a/clients/memcat.cc +++ b/clients/memcat.cc @@ -9,14 +9,13 @@ * */ -#include "config.h" +#include +#include +#include +#include #include -#include -#include -#include #include -#include #include #include "utilities.h" @@ -81,10 +80,15 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - if (opt_username and initialize_sasl(memc, opt_username, opt_passwd) == false) + if (opt_username) { - memcached_free(memc); - return EXIT_FAILURE; + memcached_return_t ret; + if (memcached_failed(ret= memcached_set_sasl_auth_data(memc, opt_username, opt_passwd))) + { + std::cerr << memcached_last_error_message(memc) << std::endl; + memcached_free(memc); + return EXIT_FAILURE; + } } while (optind < argc) @@ -170,8 +174,6 @@ int main(int argc, char *argv[]) if (opt_hash) free(opt_hash); - shutdown_sasl(); - return return_code; }