MEMCACHED_D...L_AUTH_DATA(3)

πŸ’– MEMCACHED_D...L_AUTH_DATA(3) πŸ’–

okay bestie, welcome to the libmemcached-awesome manual, third section, and yes the title is giving "the printer ran out of ink mid-word" but that's literally just how the name is, don't @ me πŸŽ€


✨ NAME ✨

memcached_destroy_sasl_auth_data β€” libmemcached Documentation


🌸 SYNOPSIS 🌸

#include <libmemcached/memcached.h>
Compile and link with -lmemcached

void memcached_set_sasl_callbacks(memcached_st *ptr, const
sasl_callback_t *callbacks)

Parameters

  • ptr β€” pointer to initialized memcached_st struct
  • callbacks β€” pointer to sasl_callbacks_t holding the callbacks to use

const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr)

Parameters

  • ptr β€” pointer to initialized memcached_st struct

Returns

pointer to sasl_callbacks_t holding the callbacks currently used


memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const
char *username, const char *password)

Parameters

  • ptr β€” pointer to initialized memcached_st struct
  • username β€” (yes bestie, it's just… blank in the original, I'm not hiding anything from you, that's literally all it says πŸ™ˆ)
  • password β€” (same situation, empty in the source, no cap)

Returns

memcached_return_t indicating success


memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr)

Parameters

  • ptr β€” pointer to initialized memcached_st struct

Returns

memcached_return_t indicating success


πŸ¦‹ DESCRIPTION πŸ¦‹

libmemcached lets you plug in your very own callbacks function, the one libsasl uses to do SASL authentication. main character energy, honestly πŸ’…

⚠️ heads up bestie ⚠️ SASL requires the memcached binary protocol, and you have to specify the callbacks before you connect to the server. No sneaking them in after, periodt.

memcached_set_sasl_auth_data() is a lil helper function that defines the basic functionality for you β€” iconic, generous, we love her β€” but it will store the username and password in memory. If you go this route, you have to call memcached_destroy_sasl_auth_data() before calling memcached_free(), or you get a memory leak and that is not the vibe 😭

And listen: you should NOT call memcached_destroy_sasl_auth_data() if you specify your own callback function with memcached_set_sasl_callbacks(). Like, do not. Fr fr. 🫢

⭐ RETURN VALUE ⭐

memcached_get_sasl_callbacks() returns the callbacks currently used by this memcached handle. memcached_set_sasl_auth_data() returns MEMCACHED_SUCCESS upon success. slay ✨


🌈 SEE ALSO 🌈


and that's the whole page, bestie β€” version 1.1, dated Jul 24, 2025, brought to you by libmemcached-awesome. go forth and authenticate responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ‘‘

πŸ“¦ where this page comes from