Apache HTTPD
Classes | Macros | Functions | Variables
apr_memcache.c File Reference
#include "apr_memcache.h"
#include "apr_poll.h"
#include "apr_version.h"
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  apr_memcache_conn_t
 
struct  cache_server_query_t
 

Macros

#define BUFFER_SIZE   512
 
#define MC_EOL   "\r\n"
 
#define MC_EOL_LEN   (sizeof(MC_EOL)-1)
 
#define MC_WS   " "
 
#define MC_WS_LEN   (sizeof(MC_WS)-1)
 
#define MC_GET   "get "
 
#define MC_GET_LEN   (sizeof(MC_GET)-1)
 
#define MC_SET   "set "
 
#define MC_SET_LEN   (sizeof(MC_SET)-1)
 
#define MC_ADD   "add "
 
#define MC_ADD_LEN   (sizeof(MC_ADD)-1)
 
#define MC_REPLACE   "replace "
 
#define MC_REPLACE_LEN   (sizeof(MC_REPLACE)-1)
 
#define MC_DELETE   "delete "
 
#define MC_DELETE_LEN   (sizeof(MC_DELETE)-1)
 
#define MC_INCR   "incr "
 
#define MC_INCR_LEN   (sizeof(MC_INCR)-1)
 
#define MC_DECR   "decr "
 
#define MC_DECR_LEN   (sizeof(MC_DECR)-1)
 
#define MC_VERSION   "version"
 
#define MC_VERSION_LEN   (sizeof(MC_VERSION)-1)
 
#define MC_STATS   "stats"
 
#define MC_STATS_LEN   (sizeof(MC_STATS)-1)
 
#define MC_QUIT   "quit"
 
#define MC_QUIT_LEN   (sizeof(MC_QUIT)-1)
 
#define MS_STORED   "STORED"
 
#define MS_STORED_LEN   (sizeof(MS_STORED)-1)
 
#define MS_NOT_STORED   "NOT_STORED"
 
#define MS_NOT_STORED_LEN   (sizeof(MS_NOT_STORED)-1)
 
#define MS_DELETED   "DELETED"
 
#define MS_DELETED_LEN   (sizeof(MS_DELETED)-1)
 
#define MS_NOT_FOUND   "NOT_FOUND"
 
#define MS_NOT_FOUND_LEN   (sizeof(MS_NOT_FOUND)-1)
 
#define MS_VALUE   "VALUE"
 
#define MS_VALUE_LEN   (sizeof(MS_VALUE)-1)
 
#define MS_ERROR   "ERROR"
 
#define MS_ERROR_LEN   (sizeof(MS_ERROR)-1)
 
#define MS_VERSION   "VERSION"
 
#define MS_VERSION_LEN   (sizeof(MS_VERSION)-1)
 
#define MS_STAT   "STAT"
 
#define MS_STAT_LEN   (sizeof(MS_STAT)-1)
 
#define MS_END   "END"
 
#define MS_END_LEN   (sizeof(MS_END)-1)
 
#define MULT_GET_TIMEOUT   50000
 
#define STAT_pid   MS_STAT " pid "
 
#define STAT_pid_LEN   (sizeof(STAT_pid)-1)
 
#define STAT_uptime   MS_STAT " uptime "
 
#define STAT_uptime_LEN   (sizeof(STAT_uptime)-1)
 
#define STAT_time   MS_STAT " time "
 
#define STAT_time_LEN   (sizeof(STAT_time)-1)
 
#define STAT_version   MS_STAT " version "
 
#define STAT_version_LEN   (sizeof(STAT_version)-1)
 
#define STAT_pointer_size   MS_STAT " pointer_size "
 
#define STAT_pointer_size_LEN   (sizeof(STAT_pointer_size)-1)
 
#define STAT_rusage_user   MS_STAT " rusage_user "
 
#define STAT_rusage_user_LEN   (sizeof(STAT_rusage_user)-1)
 
#define STAT_rusage_system   MS_STAT " rusage_system "
 
#define STAT_rusage_system_LEN   (sizeof(STAT_rusage_system)-1)
 
#define STAT_curr_items   MS_STAT " curr_items "
 
#define STAT_curr_items_LEN   (sizeof(STAT_curr_items)-1)
 
#define STAT_total_items   MS_STAT " total_items "
 
#define STAT_total_items_LEN   (sizeof(STAT_total_items)-1)
 
#define STAT_bytes   MS_STAT " bytes "
 
#define STAT_bytes_LEN   (sizeof(STAT_bytes)-1)
 
#define STAT_curr_connections   MS_STAT " curr_connections "
 
#define STAT_curr_connections_LEN   (sizeof(STAT_curr_connections)-1)
 
#define STAT_total_connections   MS_STAT " total_connections "
 
#define STAT_total_connections_LEN   (sizeof(STAT_total_connections)-1)
 
#define STAT_connection_structures   MS_STAT " connection_structures "
 
#define STAT_connection_structures_LEN   (sizeof(STAT_connection_structures)-1)
 
#define STAT_cmd_get   MS_STAT " cmd_get "
 
#define STAT_cmd_get_LEN   (sizeof(STAT_cmd_get)-1)
 
#define STAT_cmd_set   MS_STAT " cmd_set "
 
#define STAT_cmd_set_LEN   (sizeof(STAT_cmd_set)-1)
 
#define STAT_get_hits   MS_STAT " get_hits "
 
#define STAT_get_hits_LEN   (sizeof(STAT_get_hits)-1)
 
#define STAT_get_misses   MS_STAT " get_misses "
 
#define STAT_get_misses_LEN   (sizeof(STAT_get_misses)-1)
 
#define STAT_evictions   MS_STAT " evictions "
 
#define STAT_evictions_LEN   (sizeof(STAT_evictions)-1)
 
#define STAT_bytes_read   MS_STAT " bytes_read "
 
#define STAT_bytes_read_LEN   (sizeof(STAT_bytes_read)-1)
 
#define STAT_bytes_written   MS_STAT " bytes_written "
 
#define STAT_bytes_written_LEN   (sizeof(STAT_bytes_written)-1)
 
#define STAT_limit_maxbytes   MS_STAT " limit_maxbytes "
 
#define STAT_limit_maxbytes_LEN   (sizeof(STAT_limit_maxbytes)-1)
 
#define STAT_threads   MS_STAT " threads "
 
#define STAT_threads_LEN   (sizeof(STAT_threads)-1)
 
#define mc_stat_cmp(name)    strncmp(STAT_ ## name, conn->buffer, STAT_ ## name ## _LEN) == 0
 
#define mc_stat_str(name)
 
#define mc_stat_uint32(name)
 
#define mc_stat_uint64(name)
 
#define mc_stat_time(name)
 
#define mc_stat_rtime(name)
 
#define mc_do_stat(name, type)
 

Functions

static apr_status_t make_server_dead (apr_memcache_t *mc, apr_memcache_server_t *ms)
 
static apr_status_t make_server_live (apr_memcache_t *mc, apr_memcache_server_t *ms)
 
 APU_DECLARE (apr_status_t)
 
static apr_status_t mc_version_ping (apr_memcache_server_t *ms)
 
 apr_memcache_find_server_hash (apr_memcache_t *mc, const apr_uint32_t hash)
 
 apr_memcache_find_server_hash_default (void *baton, apr_memcache_t *mc, const apr_uint32_t hash)
 
 APU_DECLARE (apr_memcache_server_t *)
 
static apr_status_t ms_find_conn (apr_memcache_server_t *ms, apr_memcache_conn_t **conn)
 
static apr_status_t ms_bad_conn (apr_memcache_server_t *ms, apr_memcache_conn_t *conn)
 
static apr_status_t ms_release_conn (apr_memcache_server_t *ms, apr_memcache_conn_t *conn)
 
static apr_status_t conn_connect (apr_memcache_conn_t *conn)
 
static apr_status_t mc_conn_construct (void **conn_, void *params, apr_pool_t *pool)
 
 APU_DECLARE (apr_uint32_t)
 
static apr_status_t get_server_line (apr_memcache_conn_t *conn)
 
static apr_status_t storage_cmd_write (apr_memcache_t *mc, char *cmd, const apr_size_t cmd_size, const char *key, char *data, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags)
 
 apr_memcache_set (apr_memcache_t *mc, const char *key, char *data, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags)
 
 apr_memcache_add (apr_memcache_t *mc, const char *key, char *data, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags)
 
 apr_memcache_replace (apr_memcache_t *mc, const char *key, char *data, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags)
 
static int parse_size (const char *size_str, apr_size_t *size)
 
 apr_memcache_getp (apr_memcache_t *mc, apr_pool_t *p, const char *key, char **baton, apr_size_t *new_length, apr_uint16_t *flags_)
 
 apr_memcache_delete (apr_memcache_t *mc, const char *key, apr_uint32_t timeout)
 
static apr_status_t num_cmd_write (apr_memcache_t *mc, char *cmd, const apr_uint32_t cmd_size, const char *key, const apr_int32_t inc, apr_uint32_t *new_value)
 
 apr_memcache_incr (apr_memcache_t *mc, const char *key, apr_int32_t inc, apr_uint32_t *new_value)
 
 apr_memcache_decr (apr_memcache_t *mc, const char *key, apr_int32_t inc, apr_uint32_t *new_value)
 
 apr_memcache_version (apr_memcache_server_t *ms, apr_pool_t *p, char **baton)
 
 apr_memcache_add_multget_key (apr_pool_t *data_pool, const char *key, apr_hash_t **values)
 
static void mget_conn_result (int serverup, int connup, apr_status_t rv, apr_memcache_t *mc, apr_memcache_server_t *ms, apr_memcache_conn_t *conn, struct cache_server_query_t *server_query, apr_hash_t *values, apr_hash_t *server_queries)
 
 apr_memcache_multgetp (apr_memcache_t *mc, apr_pool_t *temp_pool, apr_pool_t *data_pool, apr_hash_t *values)
 
static const charstat_read_string (apr_pool_t *p, char *buf, apr_size_t len)
 
static apr_uint32_t stat_read_uint32 (apr_pool_t *p, char *buf, apr_size_t len)
 
static apr_uint64_t stat_read_uint64 (apr_pool_t *p, char *buf, apr_size_t len)
 
static apr_time_t stat_read_time (apr_pool_t *p, char *buf, apr_size_t len)
 
static apr_time_t stat_read_rtime (apr_pool_t *p, char *buf, apr_size_t len)
 
static void update_stats (apr_pool_t *p, apr_memcache_conn_t *conn, apr_memcache_stats_t *stats)
 
 apr_memcache_stats (apr_memcache_server_t *ms, apr_pool_t *p, apr_memcache_stats_t **stats)
 

Variables

static const apr_uint32_t crc32tab [256]
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   512

Definition at line 22 of file apr_memcache.c.

◆ MC_ADD

#define MC_ADD   "add "

Definition at line 49 of file apr_memcache.c.

◆ MC_ADD_LEN

#define MC_ADD_LEN   (sizeof(MC_ADD)-1)

Definition at line 50 of file apr_memcache.c.

◆ MC_DECR

#define MC_DECR   "decr "

Definition at line 61 of file apr_memcache.c.

◆ MC_DECR_LEN

#define MC_DECR_LEN   (sizeof(MC_DECR)-1)

Definition at line 62 of file apr_memcache.c.

◆ MC_DELETE

#define MC_DELETE   "delete "

Definition at line 55 of file apr_memcache.c.

◆ MC_DELETE_LEN

#define MC_DELETE_LEN   (sizeof(MC_DELETE)-1)

Definition at line 56 of file apr_memcache.c.

◆ mc_do_stat

#define mc_do_stat (   name,
  type 
)
Value:
if (mc_stat_cmp(name)) { \
stats-> name = mc_stat_ ## type ((STAT_ ## name ## _LEN)); \
}
#define mc_stat_cmp(name)
apr_pool_t apr_memcache_stats_t ** stats
apr_size_t size
int type
char * name

Definition at line 1628 of file apr_memcache.c.

◆ MC_EOL

#define MC_EOL   "\r\n"

Definition at line 37 of file apr_memcache.c.

◆ MC_EOL_LEN

#define MC_EOL_LEN   (sizeof(MC_EOL)-1)

Definition at line 38 of file apr_memcache.c.

◆ MC_GET

#define MC_GET   "get "

Definition at line 43 of file apr_memcache.c.

◆ MC_GET_LEN

#define MC_GET_LEN   (sizeof(MC_GET)-1)

Definition at line 44 of file apr_memcache.c.

◆ MC_INCR

#define MC_INCR   "incr "

Definition at line 58 of file apr_memcache.c.

◆ MC_INCR_LEN

#define MC_INCR_LEN   (sizeof(MC_INCR)-1)

Definition at line 59 of file apr_memcache.c.

◆ MC_QUIT

#define MC_QUIT   "quit"

Definition at line 70 of file apr_memcache.c.

◆ MC_QUIT_LEN

#define MC_QUIT_LEN   (sizeof(MC_QUIT)-1)

Definition at line 71 of file apr_memcache.c.

◆ MC_REPLACE

#define MC_REPLACE   "replace "

Definition at line 52 of file apr_memcache.c.

◆ MC_REPLACE_LEN

#define MC_REPLACE_LEN   (sizeof(MC_REPLACE)-1)

Definition at line 53 of file apr_memcache.c.

◆ MC_SET

#define MC_SET   "set "

Definition at line 46 of file apr_memcache.c.

◆ MC_SET_LEN

#define MC_SET_LEN   (sizeof(MC_SET)-1)

Definition at line 47 of file apr_memcache.c.

◆ mc_stat_cmp

#define mc_stat_cmp (   name)     strncmp(STAT_ ## name, conn->buffer, STAT_ ## name ## _LEN) == 0

I got tired of Typing. Meh.

TODO: Convert it to static tables to make it cooler.

Definition at line 1604 of file apr_memcache.c.

◆ mc_stat_rtime

#define mc_stat_rtime (   name)
Value:
stat_read_rtime(p, conn->buffer + name, \
conn->blen - name)
static apr_time_t stat_read_rtime(apr_pool_t *p, char *buf, apr_size_t len)
apr_pool_t * p
Definition md_event.c:32

Definition at line 1623 of file apr_memcache.c.

◆ mc_stat_str

#define mc_stat_str (   name)
Value:
stat_read_string(p, conn->buffer + name, \
conn->blen - name)
static const char * stat_read_string(apr_pool_t *p, char *buf, apr_size_t len)

Definition at line 1607 of file apr_memcache.c.

◆ mc_stat_time

#define mc_stat_time (   name)
Value:
stat_read_time(p, conn->buffer + name, \
conn->blen - name)
static apr_time_t stat_read_time(apr_pool_t *p, char *buf, apr_size_t len)

Definition at line 1619 of file apr_memcache.c.

◆ mc_stat_uint32

#define mc_stat_uint32 (   name)
Value:
stat_read_uint32(p, conn->buffer + name, \
conn->blen - name)
static apr_uint32_t stat_read_uint32(apr_pool_t *p, char *buf, apr_size_t len)

Definition at line 1611 of file apr_memcache.c.

◆ mc_stat_uint64

#define mc_stat_uint64 (   name)
Value:
stat_read_uint64(p, conn->buffer + name, \
conn->blen - name)
static apr_uint64_t stat_read_uint64(apr_pool_t *p, char *buf, apr_size_t len)

Definition at line 1615 of file apr_memcache.c.

◆ MC_STATS

#define MC_STATS   "stats"

Definition at line 67 of file apr_memcache.c.

◆ MC_STATS_LEN

#define MC_STATS_LEN   (sizeof(MC_STATS)-1)

Definition at line 68 of file apr_memcache.c.

◆ MC_VERSION

#define MC_VERSION   "version"

Definition at line 64 of file apr_memcache.c.

◆ MC_VERSION_LEN

#define MC_VERSION_LEN   (sizeof(MC_VERSION)-1)

Definition at line 65 of file apr_memcache.c.

◆ MC_WS

#define MC_WS   " "

Definition at line 40 of file apr_memcache.c.

◆ MC_WS_LEN

#define MC_WS_LEN   (sizeof(MC_WS)-1)

Definition at line 41 of file apr_memcache.c.

◆ MS_DELETED

#define MS_DELETED   "DELETED"

Definition at line 81 of file apr_memcache.c.

◆ MS_DELETED_LEN

#define MS_DELETED_LEN   (sizeof(MS_DELETED)-1)

Definition at line 82 of file apr_memcache.c.

◆ MS_END

#define MS_END   "END"

Definition at line 99 of file apr_memcache.c.

◆ MS_END_LEN

#define MS_END_LEN   (sizeof(MS_END)-1)

Definition at line 100 of file apr_memcache.c.

◆ MS_ERROR

#define MS_ERROR   "ERROR"

Definition at line 90 of file apr_memcache.c.

◆ MS_ERROR_LEN

#define MS_ERROR_LEN   (sizeof(MS_ERROR)-1)

Definition at line 91 of file apr_memcache.c.

◆ MS_NOT_FOUND

#define MS_NOT_FOUND   "NOT_FOUND"

Definition at line 84 of file apr_memcache.c.

◆ MS_NOT_FOUND_LEN

#define MS_NOT_FOUND_LEN   (sizeof(MS_NOT_FOUND)-1)

Definition at line 85 of file apr_memcache.c.

◆ MS_NOT_STORED

#define MS_NOT_STORED   "NOT_STORED"

Definition at line 78 of file apr_memcache.c.

◆ MS_NOT_STORED_LEN

#define MS_NOT_STORED_LEN   (sizeof(MS_NOT_STORED)-1)

Definition at line 79 of file apr_memcache.c.

◆ MS_STAT

#define MS_STAT   "STAT"

Definition at line 96 of file apr_memcache.c.

◆ MS_STAT_LEN

#define MS_STAT_LEN   (sizeof(MS_STAT)-1)

Definition at line 97 of file apr_memcache.c.

◆ MS_STORED

#define MS_STORED   "STORED"

Definition at line 75 of file apr_memcache.c.

◆ MS_STORED_LEN

#define MS_STORED_LEN   (sizeof(MS_STORED)-1)

Definition at line 76 of file apr_memcache.c.

◆ MS_VALUE

#define MS_VALUE   "VALUE"

Definition at line 87 of file apr_memcache.c.

◆ MS_VALUE_LEN

#define MS_VALUE_LEN   (sizeof(MS_VALUE)-1)

Definition at line 88 of file apr_memcache.c.

◆ MS_VERSION

#define MS_VERSION   "VERSION"

Definition at line 93 of file apr_memcache.c.

◆ MS_VERSION_LEN

#define MS_VERSION_LEN   (sizeof(MS_VERSION)-1)

Definition at line 94 of file apr_memcache.c.

◆ MULT_GET_TIMEOUT

#define MULT_GET_TIMEOUT   50000

Definition at line 110 of file apr_memcache.c.

◆ STAT_bytes

#define STAT_bytes   MS_STAT " bytes "

Definition at line 1516 of file apr_memcache.c.

◆ STAT_bytes_LEN

#define STAT_bytes_LEN   (sizeof(STAT_bytes)-1)

Definition at line 1517 of file apr_memcache.c.

◆ STAT_bytes_read

#define STAT_bytes_read   MS_STAT " bytes_read "

Definition at line 1543 of file apr_memcache.c.

◆ STAT_bytes_read_LEN

#define STAT_bytes_read_LEN   (sizeof(STAT_bytes_read)-1)

Definition at line 1544 of file apr_memcache.c.

◆ STAT_bytes_written

#define STAT_bytes_written   MS_STAT " bytes_written "

Definition at line 1546 of file apr_memcache.c.

◆ STAT_bytes_written_LEN

#define STAT_bytes_written_LEN   (sizeof(STAT_bytes_written)-1)

Definition at line 1547 of file apr_memcache.c.

◆ STAT_cmd_get

#define STAT_cmd_get   MS_STAT " cmd_get "

Definition at line 1528 of file apr_memcache.c.

◆ STAT_cmd_get_LEN

#define STAT_cmd_get_LEN   (sizeof(STAT_cmd_get)-1)

Definition at line 1529 of file apr_memcache.c.

◆ STAT_cmd_set

#define STAT_cmd_set   MS_STAT " cmd_set "

Definition at line 1531 of file apr_memcache.c.

◆ STAT_cmd_set_LEN

#define STAT_cmd_set_LEN   (sizeof(STAT_cmd_set)-1)

Definition at line 1532 of file apr_memcache.c.

◆ STAT_connection_structures

#define STAT_connection_structures   MS_STAT " connection_structures "

Definition at line 1525 of file apr_memcache.c.

◆ STAT_connection_structures_LEN

#define STAT_connection_structures_LEN   (sizeof(STAT_connection_structures)-1)

Definition at line 1526 of file apr_memcache.c.

◆ STAT_curr_connections

#define STAT_curr_connections   MS_STAT " curr_connections "

Definition at line 1519 of file apr_memcache.c.

◆ STAT_curr_connections_LEN

#define STAT_curr_connections_LEN   (sizeof(STAT_curr_connections)-1)

Definition at line 1520 of file apr_memcache.c.

◆ STAT_curr_items

#define STAT_curr_items   MS_STAT " curr_items "

Definition at line 1510 of file apr_memcache.c.

◆ STAT_curr_items_LEN

#define STAT_curr_items_LEN   (sizeof(STAT_curr_items)-1)

Definition at line 1511 of file apr_memcache.c.

◆ STAT_evictions

#define STAT_evictions   MS_STAT " evictions "

Definition at line 1540 of file apr_memcache.c.

◆ STAT_evictions_LEN

#define STAT_evictions_LEN   (sizeof(STAT_evictions)-1)

Definition at line 1541 of file apr_memcache.c.

◆ STAT_get_hits

#define STAT_get_hits   MS_STAT " get_hits "

Definition at line 1534 of file apr_memcache.c.

◆ STAT_get_hits_LEN

#define STAT_get_hits_LEN   (sizeof(STAT_get_hits)-1)

Definition at line 1535 of file apr_memcache.c.

◆ STAT_get_misses

#define STAT_get_misses   MS_STAT " get_misses "

Definition at line 1537 of file apr_memcache.c.

◆ STAT_get_misses_LEN

#define STAT_get_misses_LEN   (sizeof(STAT_get_misses)-1)

Definition at line 1538 of file apr_memcache.c.

◆ STAT_limit_maxbytes

#define STAT_limit_maxbytes   MS_STAT " limit_maxbytes "

Definition at line 1549 of file apr_memcache.c.

◆ STAT_limit_maxbytes_LEN

#define STAT_limit_maxbytes_LEN   (sizeof(STAT_limit_maxbytes)-1)

Definition at line 1550 of file apr_memcache.c.

◆ STAT_pid

#define STAT_pid   MS_STAT " pid "

Define all of the strings for stats

Definition at line 1489 of file apr_memcache.c.

◆ STAT_pid_LEN

#define STAT_pid_LEN   (sizeof(STAT_pid)-1)

Definition at line 1490 of file apr_memcache.c.

◆ STAT_pointer_size

#define STAT_pointer_size   MS_STAT " pointer_size "

Definition at line 1501 of file apr_memcache.c.

◆ STAT_pointer_size_LEN

#define STAT_pointer_size_LEN   (sizeof(STAT_pointer_size)-1)

Definition at line 1502 of file apr_memcache.c.

◆ STAT_rusage_system

#define STAT_rusage_system   MS_STAT " rusage_system "

Definition at line 1507 of file apr_memcache.c.

◆ STAT_rusage_system_LEN

#define STAT_rusage_system_LEN   (sizeof(STAT_rusage_system)-1)

Definition at line 1508 of file apr_memcache.c.

◆ STAT_rusage_user

#define STAT_rusage_user   MS_STAT " rusage_user "

Definition at line 1504 of file apr_memcache.c.

◆ STAT_rusage_user_LEN

#define STAT_rusage_user_LEN   (sizeof(STAT_rusage_user)-1)

Definition at line 1505 of file apr_memcache.c.

◆ STAT_threads

#define STAT_threads   MS_STAT " threads "

Definition at line 1552 of file apr_memcache.c.

◆ STAT_threads_LEN

#define STAT_threads_LEN   (sizeof(STAT_threads)-1)

Definition at line 1553 of file apr_memcache.c.

◆ STAT_time

#define STAT_time   MS_STAT " time "

Definition at line 1495 of file apr_memcache.c.

◆ STAT_time_LEN

#define STAT_time_LEN   (sizeof(STAT_time)-1)

Definition at line 1496 of file apr_memcache.c.

◆ STAT_total_connections

#define STAT_total_connections   MS_STAT " total_connections "

Definition at line 1522 of file apr_memcache.c.

◆ STAT_total_connections_LEN

#define STAT_total_connections_LEN   (sizeof(STAT_total_connections)-1)

Definition at line 1523 of file apr_memcache.c.

◆ STAT_total_items

#define STAT_total_items   MS_STAT " total_items "

Definition at line 1513 of file apr_memcache.c.

◆ STAT_total_items_LEN

#define STAT_total_items_LEN   (sizeof(STAT_total_items)-1)

Definition at line 1514 of file apr_memcache.c.

◆ STAT_uptime

#define STAT_uptime   MS_STAT " uptime "

Definition at line 1492 of file apr_memcache.c.

◆ STAT_uptime_LEN

#define STAT_uptime_LEN   (sizeof(STAT_uptime)-1)

Definition at line 1493 of file apr_memcache.c.

◆ STAT_version

#define STAT_version   MS_STAT " version "

Definition at line 1498 of file apr_memcache.c.

◆ STAT_version_LEN

#define STAT_version_LEN   (sizeof(STAT_version)-1)

Definition at line 1499 of file apr_memcache.c.

Function Documentation

◆ apr_memcache_add()

apr_memcache_add ( apr_memcache_t mc,
const char key,
char data,
const apr_size_t  data_size,
apr_uint32_t  timeout,
apr_uint16_t  flags 
)

Definition at line 701 of file apr_memcache.c.

◆ apr_memcache_add_multget_key()

apr_memcache_add_multget_key ( apr_pool_t data_pool,
const char key,
apr_hash_t **  values 
)

Definition at line 1137 of file apr_memcache.c.

◆ apr_memcache_decr()

apr_memcache_decr ( apr_memcache_t mc,
const char key,
apr_int32_t  inc,
apr_uint32_t new_value 
)

Definition at line 1038 of file apr_memcache.c.

◆ apr_memcache_delete()

apr_memcache_delete ( apr_memcache_t mc,
const char key,
apr_uint32_t  timeout 
)

Definition at line 884 of file apr_memcache.c.

◆ apr_memcache_find_server_hash()

apr_memcache_find_server_hash ( apr_memcache_t mc,
const apr_uint32_t  hash 
)

Definition at line 149 of file apr_memcache.c.

◆ apr_memcache_find_server_hash_default()

apr_memcache_find_server_hash_default ( void *  baton,
apr_memcache_t mc,
const apr_uint32_t  hash 
)

Definition at line 160 of file apr_memcache.c.

◆ apr_memcache_getp()

apr_memcache_getp ( apr_memcache_t mc,
apr_pool_t p,
const char key,
char **  baton,
apr_size_t new_length,
apr_uint16_t flags_ 
)

Definition at line 752 of file apr_memcache.c.

◆ apr_memcache_incr()

apr_memcache_incr ( apr_memcache_t mc,
const char key,
apr_int32_t  inc,
apr_uint32_t new_value 
)

Definition at line 1023 of file apr_memcache.c.

◆ apr_memcache_multgetp()

apr_memcache_multgetp ( apr_memcache_t mc,
apr_pool_t temp_pool,
apr_pool_t data_pool,
apr_hash_t values 
)

< Can read without blocking

Definition at line 1196 of file apr_memcache.c.

◆ apr_memcache_replace()

apr_memcache_replace ( apr_memcache_t mc,
const char key,
char data,
const apr_size_t  data_size,
apr_uint32_t  timeout,
apr_uint16_t  flags 
)

Definition at line 716 of file apr_memcache.c.

◆ apr_memcache_set()

apr_memcache_set ( apr_memcache_t mc,
const char key,
char data,
const apr_size_t  data_size,
apr_uint32_t  timeout,
apr_uint16_t  flags 
)

Definition at line 686 of file apr_memcache.c.

◆ apr_memcache_stats()

apr_memcache_stats ( apr_memcache_server_t ms,
apr_pool_t p,
apr_memcache_stats_t **  stats 
)

Definition at line 1662 of file apr_memcache.c.

◆ apr_memcache_version()

apr_memcache_version ( apr_memcache_server_t ms,
apr_pool_t p,
char **  baton 
)

Definition at line 1054 of file apr_memcache.c.

◆ APU_DECLARE()

APU_DECLARE ( apr_memcache_server_t )

Definition at line 210 of file apr_memcache.c.

◆ conn_connect()

static apr_status_t conn_connect ( apr_memcache_conn_t conn)
static

Definition at line 288 of file apr_memcache.c.

◆ get_server_line()

static apr_status_t get_server_line ( apr_memcache_conn_t conn)
static

Definition at line 578 of file apr_memcache.c.

◆ make_server_dead()

static apr_status_t make_server_dead ( apr_memcache_t mc,
apr_memcache_server_t ms 
)
static

Definition at line 112 of file apr_memcache.c.

◆ make_server_live()

static apr_status_t make_server_live ( apr_memcache_t mc,
apr_memcache_server_t ms 
)
static

Definition at line 125 of file apr_memcache.c.

◆ mc_conn_construct()

static apr_status_t mc_conn_construct ( void **  conn_,
void *  params,
apr_pool_t pool 
)
static

Definition at line 323 of file apr_memcache.c.

◆ mc_version_ping()

apr_status_t mc_version_ping ( apr_memcache_server_t ms)
static

Definition at line 1103 of file apr_memcache.c.

◆ mget_conn_result()

static void mget_conn_result ( int  serverup,
int  connup,
apr_status_t  rv,
apr_memcache_t mc,
apr_memcache_server_t ms,
apr_memcache_conn_t conn,
struct cache_server_query_t server_query,
apr_hash_t values,
apr_hash_t server_queries 
)
static

Definition at line 1158 of file apr_memcache.c.

◆ ms_bad_conn()

static apr_status_t ms_bad_conn ( apr_memcache_server_t ms,
apr_memcache_conn_t conn 
)
static

Definition at line 252 of file apr_memcache.c.

◆ ms_find_conn()

static apr_status_t ms_find_conn ( apr_memcache_server_t ms,
apr_memcache_conn_t **  conn 
)
static

Definition at line 225 of file apr_memcache.c.

◆ ms_release_conn()

static apr_status_t ms_release_conn ( apr_memcache_server_t ms,
apr_memcache_conn_t conn 
)
static

Definition at line 261 of file apr_memcache.c.

◆ num_cmd_write()

static apr_status_t num_cmd_write ( apr_memcache_t mc,
char cmd,
const apr_uint32_t  cmd_size,
const char key,
const apr_int32_t  inc,
apr_uint32_t new_value 
)
static

Definition at line 950 of file apr_memcache.c.

◆ parse_size()

static int parse_size ( const char size_str,
apr_size_t size 
)
static

Definition at line 735 of file apr_memcache.c.

◆ stat_read_rtime()

static apr_time_t stat_read_rtime ( apr_pool_t p,
char buf,
apr_size_t  len 
)
static

Definition at line 1579 of file apr_memcache.c.

◆ stat_read_string()

static const char * stat_read_string ( apr_pool_t p,
char buf,
apr_size_t  len 
)
static

Definition at line 1555 of file apr_memcache.c.

◆ stat_read_time()

static apr_time_t stat_read_time ( apr_pool_t p,
char buf,
apr_size_t  len 
)
static

Definition at line 1573 of file apr_memcache.c.

◆ stat_read_uint32()

static apr_uint32_t stat_read_uint32 ( apr_pool_t p,
char buf,
apr_size_t  len 
)
static

Definition at line 1561 of file apr_memcache.c.

◆ stat_read_uint64()

static apr_uint64_t stat_read_uint64 ( apr_pool_t p,
char buf,
apr_size_t  len 
)
static

Definition at line 1567 of file apr_memcache.c.

◆ storage_cmd_write()

static apr_status_t storage_cmd_write ( apr_memcache_t mc,
char cmd,
const apr_size_t  cmd_size,
const char key,
char data,
const apr_size_t  data_size,
apr_uint32_t  timeout,
apr_uint16_t  flags 
)
static

Definition at line 601 of file apr_memcache.c.

◆ update_stats()

static void update_stats ( apr_pool_t p,
apr_memcache_conn_t conn,
apr_memcache_stats_t stats 
)
static

Definition at line 1633 of file apr_memcache.c.

Variable Documentation

◆ crc32tab

const apr_uint32_t crc32tab[256]
static

Definition at line 475 of file apr_memcache.c.