« blib/lib/Memcached/libmemcached/memcached_result_st.pm
↑ Summary
blib/lib/Memcached/libmemcached/memcached_server_st.pm »
| 1 | package Memcached::libmemcached::memcached_sasl; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | memcached_set_sasl_callbacks, memcached_get_sasl_callbacks, | ||
| 6 | memcached_sasl_set_auth_data, memcached_destroy_sasl_auth_data - SASL support | ||
| 7 | |||
| 8 | =head1 LIBRARY | ||
| 9 | |||
| 10 | C Client Library for memcached (libmemcached, -lmemcached) | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | #include <memcached.h> | ||
| 15 | |||
| 16 | void memcached_set_sasl_callbacks(memcached_st *ptr, | ||
| 17 | const sasl_callback_t *callbacks) | ||
| 18 | |||
| 19 | const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr) | ||
| 20 | |||
| 21 | memcached_return memcached_set_sasl_auth_data(memcached_st *ptr, | ||
| 22 | const char *username, | ||
| 23 | const char *password) | ||
| 24 | memcached_return memcached_destroy_sasl_auth_data(memcached_st *ptr) | ||
| 25 | |||
| 26 | |||
| 27 | =head1 DESCRIPTION | ||
| 28 | |||
| 29 | libmemcached(3) allows you to plug in your own callbacks function used by | ||
| 30 | libsasl to perform SASL authentication. | ||
| 31 | |||
| 32 | Please note that SASL requires the memcached binary protocol, and you have | ||
| 33 | to specify the callbacks before you connect to the server. | ||
| 34 | |||
| 35 | memcached_set_sasl_auth_data() is a helper function for you defining | ||
| 36 | the basic functionality for you, but it will store the username and password | ||
| 37 | in memory. If you choose to use this method you have to call | ||
| 38 | memcached_destroy_sasl_auth_data before calling memcached_free to avoid | ||
| 39 | a memory leak. You should NOT call memcached_destroy_sasl_auth_data if you | ||
| 40 | specify your own callback function with memcached_set_sasl_callbacks(). | ||
| 41 | |||
| 42 | You as a client user have to initialize libsasl by using sasl_client_init | ||
| 43 | before enabling it in libmemcached, and you have to shut down libsasl by | ||
| 44 | calling sasl_done() when you are done using SASL from libmemcached. | ||
| 45 | |||
| 46 | |||
| 47 | =head1 RETURN | ||
| 48 | |||
| 49 | memcached_get_sasl_callbacks() returns the callbacks currently used | ||
| 50 | by this memcached handle. | ||
| 51 | memcached_get_sasl_set_auth_data() returns MEMCACHED_SUCCESS upon success. | ||
| 52 | |||
| 53 | =head1 HOME | ||
| 54 | |||
| 55 | To find out more information please check: | ||
| 56 | L<http://libmemcached.org/> | ||
| 57 | |||
| 58 | =head1 AUTHOR | ||
| 59 | |||
| 60 | Trond Norbye, E<lt>trond.norbye@gmail.comE<gt> | ||
| 61 | |||
| 62 | =head1 SEE ALSO | ||
| 63 | |||
| 64 | memcached(1) libmemcached(3) | ||
| 65 | |||
| 66 | =cut | ||
| 67 | 1 | 1; |