コード例 #1
0
ファイル: storage.c プロジェクト: hnkien/libmemcached
memcached_return_t memcached_set(memcached_st *ptr, const char *key, size_t key_length,
                                 const char *value, size_t value_length,
                                 time_t expiration,
                                 uint32_t flags)
{
  memcached_return_t rc;
  LIBMEMCACHED_MEMCACHED_SET_START();
  rc= memcached_send(ptr, key, key_length,
                     key, key_length, value, value_length,
                     expiration, flags, 0, SET_OP);
  LIBMEMCACHED_MEMCACHED_SET_END();
  return rc;
}
コード例 #2
0
ファイル: memcached_storage.c プロジェクト: camilo/memcached
memcached_return memcached_set(memcached_st *ptr, const char *key, size_t key_length,
                               const char *value, size_t value_length,
                               time_t expiration,
                               uint32_t flags)
{
  memcached_return rc;
  LIBMEMCACHED_MEMCACHED_SET_START();

  if (value_length > SLAB_SIZE)
  {
    return MEMCACHED_NOTSTORED;
  }

  rc= memcached_send(ptr, key, key_length,
                     key, key_length, value, value_length,
                     expiration, flags, 0, SET_OP);
  LIBMEMCACHED_MEMCACHED_SET_END();
  return rc;
}