X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fsasl.cc;h=ce61e3182f93421c5d1fc7c562d957e467df50a5;hb=3dc31b013fe325e7c2f5946e37546d2b1a014509;hp=2e9bdc635d547514f1ef557cd5642e2dfee602f7;hpb=f5838944c3424afa14765d709a127c943f1cf87b;p=m6w6%2Flibmemcached diff --git a/libmemcached/sasl.cc b/libmemcached/sasl.cc index 2e9bdc63..ce61e318 100644 --- a/libmemcached/sasl.cc +++ b/libmemcached/sasl.cc @@ -40,7 +40,10 @@ #if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPORT +#if defined(HAVE_LIBSASL) && HAVE_LIBSASL #include +#endif + #include void memcached_set_sasl_callbacks(memcached_st *ptr, @@ -133,9 +136,10 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s } /* SANITY CHECK: SASL can only be used with the binary protocol */ - if (server->root->flags.binary_protocol == false) + if (memcached_is_binary(server->root) == false) { - return MEMCACHED_PROTOCOL_ERROR; + return memcached_set_error(*server, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT, + memcached_literal_param("memcached_sasl_authenticate_connection() is not supported via the ASCII protocol")); } /* Try to get the supported mech from the server. Servers without SASL @@ -229,7 +233,7 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s do { /* send the packet */ - struct libmemcached_io_vector_st vector[]= + libmemcached_io_vector_st vector[]= { { request.bytes, sizeof(request.bytes) }, { chosenmech, keylen },