projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge from build trunk.
[awesomized/libmemcached]
/
libmemcached
/
sasl.cc
diff --git
a/libmemcached/sasl.cc
b/libmemcached/sasl.cc
index 3aefb701f9bfd93cb0fa343f3cf7feeff5752f4c..902ccd872cf77ee7ede0903730a31c6c9bd96f3d 100644
(file)
--- a/
libmemcached/sasl.cc
+++ b/
libmemcached/sasl.cc
@@
-133,9
+133,10
@@
memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s
}
/* SANITY CHECK: SASL can only be used with the binary protocol */
}
/* 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
}
/* Try to get the supported mech from the server. Servers without SASL
@@
-229,11
+230,11
@@
memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *s
do {
/* send the packet */
do {
/* send the packet */
-
struct
libmemcached_io_vector_st vector[]=
+ libmemcached_io_vector_st vector[]=
{
{
- {
sizeof(request.bytes), request.bytes
},
- {
keylen, chosenmech
},
- {
len, data
}
+ {
request.bytes, sizeof(request.bytes)
},
+ {
chosenmech, keylen
},
+ {
data, len
}
};
if (memcached_io_writev(server, vector, 3, true) == -1)
};
if (memcached_io_writev(server, vector, 3, true) == -1)
@@
-321,7
+322,7
@@
memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr,
memcached_destroy_sasl_auth_data(ptr);
memcached_destroy_sasl_auth_data(ptr);
- sasl_callback_t *callbacks=
(sasl_callback_t*)libmemcached_calloc(ptr, 4, sizeof(sasl_callback_t)
);
+ sasl_callback_t *callbacks=
libmemcached_xcalloc(ptr, 4, sasl_callback_t
);
size_t password_length= strlen(password);
size_t username_length= strlen(username);
char *name= (char *)libmemcached_malloc(ptr, username_length +1);
size_t password_length= strlen(password);
size_t username_length= strlen(username);
char *name= (char *)libmemcached_malloc(ptr, username_length +1);
@@
-441,7
+442,7
@@
memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcached_st
++total;
}
++total;
}
- sasl_callback_t *callbacks=
(sasl_callback_t*)libmemcached_calloc(clone, total +1, sizeof(sasl_callback_t)
);
+ sasl_callback_t *callbacks=
libmemcached_xcalloc(clone, total +1, sasl_callback_t
);
if (callbacks == NULL)
{
return MEMCACHED_MEMORY_ALLOCATION_FAILURE;
if (callbacks == NULL)
{
return MEMCACHED_MEMORY_ALLOCATION_FAILURE;