Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-187
[m6w6/libmemcached] / docs / memcached_sasl.rst
1 ============
2 SASL support
3 ============
4
5 .. index:: object: memcached_st
6
7
8 --------
9 SYNOPSIS
10 --------
11
12 #include <libmemcached/memcached_pool.h>
13
14 .. c:function:: void memcached_set_sasl_callbacks(memcached_st *ptr, const sasl_callback_t *callbacks)
15
16 .. c:function:: const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr)
17
18 .. c:function:: memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const char *username, const char *password)
19
20 .. c:function:: memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr)
21
22 Compile and link with -lmemcached
23
24
25
26 -----------
27 DESCRIPTION
28 -----------
29
30
31 libmemcached(3) allows you to plug in your own callbacks function used by
32 libsasl to perform SASL authentication.
33
34 Please note that SASL requires the memcached binary protocol, and you have
35 to specify the callbacks before you connect to the server.
36
37 :c:func:`memcached_set_sasl_auth_data` is a helper function defining
38 the basic functionality for you, but it will store the username and password
39 in memory. If you choose to use this method you have to call
40 :c:type:`memcached_destroy_sasl_auth_data` before calling
41 :c:type:`memcached_free` to avoid a memory leak. You should NOT call
42 :c:type:`memcached_destroy_sasl_auth_data` if you specify your own callback
43 function with :c:func:`memcached_set_sasl_callbacks`.
44
45
46 ------
47 RETURN
48 ------
49
50
51 :c:func:`memcached_get_sasl_callbacks` returns the callbacks currently used by
52 this memcached handle. :c:func:`memcached_set_sasl_auth_data` returns
53 :c:type:`MEMCACHED_SUCCESS` upon success.
54
55
56 ----
57 HOME
58 ----
59
60
61 To find out more information please check:
62 `http://libmemcached.org/ <http://libmemcached.org/>`_
63
64
65 ------
66 AUTHOR
67 ------
68
69
70 Brian Aker, <brian@tangent.org>
71
72 Trond Norbye, <trond.norbye@gmail.com>
73
74
75 --------
76 SEE ALSO
77 --------
78
79
80 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`