Lines Matching refs:ctx
68 ap_socache_instance_t *ctx;
70 *context = ctx = apr_palloc(p, sizeof *ctx);
76 ctx->servers = apr_pstrdup(p, arg);
81 static apr_status_t socache_mc_init(ap_socache_instance_t *ctx,
96 cache_config = apr_pstrdup(p, ctx->servers);
103 rv = apr_memcache_create(p, nservers, 0, &ctx->mc);
112 cache_config = apr_pstrdup(p, ctx->servers);
152 rv = apr_memcache_add_server(ctx->mc, st);
163 ctx->tag = apr_pstrcat(p, namespace, ":", NULL);
164 ctx->taglen = strlen(ctx->tag) + 1;
167 AP_DEBUG_ASSERT(ctx->taglen <= 16);
180 static int socache_mc_id2key(ap_socache_instance_t *ctx,
186 if (idlen * 2 + ctx->taglen >= keylen)
189 cp = apr_cpystrn(key, ctx->tag, ctx->taglen);
195 static apr_status_t socache_mc_store(ap_socache_instance_t *ctx, server_rec *s,
204 if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
214 rv = apr_memcache_set(ctx->mc, buf, (char*)ucaData, nData,
227 static apr_status_t socache_mc_retrieve(ap_socache_instance_t *ctx, server_rec *s,
236 if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
243 rv = apr_memcache_getp(ctx->mc, p, buf, &data, &data_len, NULL);
263 static apr_status_t socache_mc_remove(ap_socache_instance_t *ctx, server_rec *s,
270 if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
274 rv = apr_memcache_delete(ctx->mc, buf, 0);
285 static void socache_mc_status(ap_socache_instance_t *ctx, request_rec *r, int flags)