Lines Matching refs:key

991 static void set_cache_value(const char *name, apr_time_t t, char *key,
1028 * We need to copy the key and the value into OUR pool,
1032 apr_pstrdup(map->pool, key), APR_HASH_KEY_STRING,
1043 static char *get_cache_value(const char *name, apr_time_t t, char *key,
1063 val = apr_hash_get(map->entries, key, APR_HASH_KEY_STRING);
1107 * General Note: key is already a fresh string, created (expanded) just
1108 * for the purpose to be passed in here. So one can modify key itself.
1111 static char *rewrite_mapfunc_toupper(request_rec *r, char *key)
1113 ap_str_toupper(key);
1115 return key;
1118 static char *rewrite_mapfunc_tolower(request_rec *r, char *key)
1120 ap_str_tolower(key);
1122 return key;
1125 static char *rewrite_mapfunc_escape(request_rec *r, char *key)
1127 return ap_escape_uri(r->pool, key);
1130 static char *rewrite_mapfunc_unescape(request_rec *r, char *key)
1132 ap_unescape_url(key);
1134 return key;
1272 static char *lookup_map_txtfile(request_rec *r, const char *file, char *key)
1287 keylast = key + strlen(key);
1298 c = key;
1304 /* key doesn't match - ignore. */
1333 const char *dbmtype, char *key)
1349 dbmkey.dptr = key;
1350 dbmkey.dsize = strlen(key);
1363 static char *lookup_map_dbd(request_rec *r, char *key, const char *label)
1377 stmt, 0, key, NULL);
1381 "rewritemap: error %s querying for %s", errmsg, key);
1399 "rewritemap: error %s looking up %s", errmsg, key);
1408 rewritelog((r, 3, NULL, "Multiple values found for %s", key));
1414 apr_file_t *fpout, char *key)
1435 * newlines in the key leave bytes in the pipe and cause
1437 * after the \n instead of the new key etc etc - in other words,
1440 if (fpin == NULL || fpout == NULL || ap_strchr(key, '\n')) {
1455 /* write out the request key */
1457 nbytes = strlen(key);
1459 apr_file_write_full(fpin, key, nbytes, NULL);
1463 iova[0].iov_base = key;
1464 iova[0].iov_len = strlen(key);
1580 static char *lookup_map(request_rec *r, char *name, char *key)
1611 value = get_cache_value(s->cachename, st.mtime, key, r->pool);
1616 value = lookup_map_txtfile(r, s->datafile, key);
1618 rewritelog((r, 5, NULL, "map lookup FAILED: map=%s[txt] key=%s",
1619 name, key));
1620 set_cache_value(s->cachename, st.mtime, key, "");
1624 rewritelog((r, 5, NULL,"map lookup OK: map=%s[txt] key=%s -> val=%s",
1625 name, key, value));
1626 set_cache_value(s->cachename, st.mtime, key, value);
1629 rewritelog((r,5,NULL,"cache lookup OK: map=%s[txt] key=%s -> val=%s",
1630 name, key, value));
1667 value = get_cache_value(s->cachename, st.mtime, key, r->pool);
1672 value = lookup_map_dbmfile(r, s->datafile, s->dbmtype, key);
1674 rewritelog((r, 5, NULL, "map lookup FAILED: map=%s[dbm] key=%s",
1675 name, key));
1676 set_cache_value(s->cachename, st.mtime, key, "");
1680 rewritelog((r, 5, NULL, "map lookup OK: map=%s[dbm] key=%s -> "
1681 "val=%s", name, key, value));
1683 set_cache_value(s->cachename, st.mtime, key, value);
1687 rewritelog((r, 5, NULL, "cache lookup OK: map=%s[dbm] key=%s -> val=%s",
1688 name, key, value));
1695 value = lookup_map_dbd(r, key, s->dbdq);
1697 rewritelog((r, 5, NULL, "SQL map lookup FAILED: map %s key=%s",
1698 name, key));
1702 rewritelog((r, 5, NULL, "SQL map lookup OK: map %s key=%s, val=%s",
1703 name, key, value));
1711 value = get_cache_value(s->cachename, 0, key, r->pool);
1716 value = lookup_map_dbd(r, key, s->dbdq);
1718 rewritelog((r, 5, NULL, "SQL map lookup FAILED: map %s key=%s",
1719 name, key));
1720 set_cache_value(s->cachename, 0, key, "");
1724 rewritelog((r, 5, NULL, "SQL map lookup OK: map %s key=%s, val=%s",
1725 name, key, value));
1727 set_cache_value(s->cachename, 0, key, value);
1731 rewritelog((r, 5, NULL, "cache lookup OK: map=%s[SQL] key=%s, val=%s",
1732 name, key, value));
1739 value = lookup_map_program(r, s->fpin, s->fpout, key);
1741 rewritelog((r, 5,NULL,"map lookup FAILED: map=%s key=%s", name,
1742 key));
1746 rewritelog((r, 5, NULL, "map lookup OK: map=%s key=%s -> val=%s",
1747 name, key, value));
1754 value = s->func(r, key);
1756 rewritelog((r, 5,NULL,"map lookup FAILED: map=%s key=%s", name,
1757 key));
1761 rewritelog((r, 5, NULL, "map lookup OK: map=%s key=%s -> val=%s",
1762 name, key, value));
2335 char *key;
2338 * To make rewrite maps useful, the lookup key and
2350 key = find_char_in_curlies(p+2, ':');
2351 if (!key) {
2361 key = map + (key-p-2);
2362 *key++ = '\0';
2363 dflt = find_char_in_curlies(key, '|');
2368 /* reuse of key variable as result */
2369 key = lookup_map(ctx->r, map, do_expand(key, ctx, entry));
2371 if (!key && dflt && *dflt) {
2372 key = do_expand(dflt, ctx, entry);
2375 if (key) {
2376 span = strlen(key);
2378 current->string = key;
3200 static const char *cmd_parseflagfield(apr_pool_t *p, void *cfg, char *key,
3208 endp = key + strlen(key) - 1;
3210 if (*key != '[' || *endp != ']') {
3215 ++key;
3217 while (*key) {
3219 while (apr_isspace(*key)) {
3220 ++key;
3223 if (!*key || (nextp = ap_strchr(key, ',')) == NULL) { /* NULL should not
3236 /* split key and val */
3237 val = ap_strchr(key, '=');
3245 err = parse(p, cfg, key, val);
3250 key = nextp + 1;
3257 char *key, char *val)
3261 if ( strcasecmp(key, "nocase") == 0
3262 || strcasecmp(key, "NC") == 0 ) {
3265 else if ( strcasecmp(key, "ornext") == 0
3266 || strcasecmp(key, "OR") == 0 ) {
3269 else if ( strcasecmp(key, "novary") == 0
3270 || strcasecmp(key, "NV") == 0 ) {
3274 return apr_pstrcat(p, "unknown flag '", key, "'", NULL);
3457 char *key, char *val)
3462 switch (*key++) {
3465 if (!*key || !strcasecmp(key, "ackrefescaping")) {
3471 else if (!strcasecmp(key, "NP") || !strcasecmp(key, "ackrefernoplus")) {
3480 if (!*key || !strcasecmp(key, "hain")) { /* chain */
3483 else if (((*key == 'O' || *key == 'o') && !key[1])
3484 || !strcasecmp(key, "ookie")) { /* cookie */
3507 if (!*key || !strcasecmp(key, "PI") || !strcasecmp(key,"iscardpath")) {
3513 if (!*key || !strcasecmp(key, "nv")) { /* env */
3530 else if (!strcasecmp(key, "nd")) { /* end */
3540 if (!*key || !strcasecmp(key, "orbidden")) { /* forbidden */
3551 if (!*key || !strcasecmp(key, "one")) { /* gone */
3562 if (!*key || !strcasecmp(key, "andler")) { /* handler */
3571 if (!*key || !strcasecmp(key, "ast")) { /* last */
3581 if (((*key == 'E' || *key == 'e') && !key[1])
3582 || !strcasecmp(key, "oescape")) { /* noescape */
3585 else if (!*key || !strcasecmp(key, "ext")) { /* next */
3592 else if (((*key == 'S' || *key == 's') && !key[1])
3593 || !strcasecmp(key, "osubreq")) { /* nosubreq */
3596 else if (((*key == 'C' || *key == 'c') && !key[1])
3597 || !strcasecmp(key, "ocase")) { /* nocase */
3607 if (!*key || !strcasecmp(key, "roxy")) { /* proxy */
3610 else if (((*key == 'T' || *key == 't') && !key[1])
3611 || !strcasecmp(key, "assthrough")) { /* passthrough */
3621 if ( !strcasecmp(key, "SA")
3622 || !strcasecmp(key, "sappend")) { /* qsappend */
3624 } else if ( !strcasecmp(key, "SD")
3625 || !strcasecmp(key, "sdiscard") ) { /* qsdiscard */
3635 if (!*key || !strcasecmp(key, "edirect")) { /* redirect */
3676 if (!*key || !strcasecmp(key, "kip")) { /* skip */
3686 if (!*key || !strcasecmp(key, "ype")) { /* type */
3699 return apr_pstrcat(p, "unknown flag '", --key, "'", NULL);