#include "config.h"
+#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
memcached_server_list_free(servers);
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 (initialize_sasl(memc, opt_username, opt_passwd) == false)
{
+ std::cerr << "Failed to initialize SASL support." << std::endl;
memcached_free(memc);
return EXIT_FAILURE;
}