MEMCACHED_S...L_CALLBACKS(3)

πŸ’– MEMCACHED_S...L_CALLBACKS(3) πŸ’–

okay bestie, sit down, hydrate, because today we're talking about the libmemcached-awesome manual page for SASL callbacks. yes that's a lot of consonants. no you don't have to be scared. i got you 🫢


✨ NAME ✨

memcached_set_sasl_callbacks β€” libmemcached Documentation

like, that's the whole name section. it's giving minimal. we love that for it πŸ’…


🌸 SYNOPSIS 🌸

#include <libmemcached/memcached.h>

and bestie, you gotta compile and link with -lmemcached, no cap.

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 queen, that's literally all it says)
  • password β€” (same energy)

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 πŸ¦‹

okay so here's the tea β˜• β€” libmemcached lets you plug in your own callbacks function that libsasl uses to do SASL authentication. your callbacks, your rules, main character energy only.

⚠️ bestie, listen. SASL requires the memcached binary protocol, and you have to specify the callbacks before you connect to the server. not after. before. the vibes are strict on this one. πŸ’€

memcached_set_sasl_auth_data() is a lil helper function that defines the basic functionality for you β€” but heads up, it will store the username and password in memory. so if you choose to use this method you have to call memcached_destroy_sasl_auth_data() before calling memcached_free() to avoid a memory leak. do not skip this step, i am begging πŸ™ˆ

🚨 and you should NOT call memcached_destroy_sasl_auth_data() if you specify your own callback function with memcached_set_sasl_callbacks(). like, don't. that's not your moment.

⭐ 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 πŸ’– this lil icon was brought to you by libmemcached-awesome, version 1.1, dated Jul 24, 2025 β€” go forth and authenticate responsibly πŸŽ€πŸŒˆπŸ¦‹

πŸ“¦ where this page comes from