Lines Matching defs:hdr

142     header_entry *hdr;
148 header_entry *hdr;
186 static const char *unwrap_header(apr_pool_t *p, const char *hdr)
188 if (ap_strchr_c(hdr, APR_ASCII_LF) || ap_strchr_c(hdr, APR_ASCII_CR)) {
191 hdr = ptr = apr_pstrdup(p, hdr);
198 return hdr;
391 static char *parse_format_string(cmd_parms *cmd, header_entry *hdr, const char *s)
397 if (hdr->action == hdr_unset || hdr->action == hdr_echo) {
401 else if (hdr->action == hdr_edit || hdr->action == hdr_edit_r ) {
402 s = hdr->subs;
407 hdr->expr_out = ap_expr_parse_cmd(cmd, s+5,
417 hdr->ta = apr_array_make(p, 10, sizeof(format_tag));
420 if ((res = parse_format_tag(p, (format_tag *) apr_array_push(hdr->ta), &s))) {
431 const char *hdr,
513 regex = ap_pregcomp(cmd->pool, hdr, AP_REG_EXTENDED | AP_REG_NOSUB);
551 if ((colon = ap_strchr_c(hdr, ':'))) {
552 hdr = apr_pstrmemdup(cmd->pool, hdr, colon-hdr);
555 new->header = hdr;
567 const char *hdr;
582 hdr = ap_getword_conf(cmd->pool, &args);
592 return header_inout_cmd(cmd, indirconf, action, hdr, val, subs, envclause);
604 static char* process_tags(header_entry *hdr, request_rec *r)
611 if (hdr->expr_out) {
614 val = ap_expr_str_exec(r, hdr->expr_out, &err);
623 tag = (format_tag*) hdr->ta->elts;
625 for (i = 0; i < hdr->ta->nelts; i++) {
634 static const char *process_regexp(header_entry *hdr, const char *value,
642 if (ap_regexec(hdr->regex, value, AP_MAX_REG_MATCH, pmatch, 0)) {
649 subs = ap_pregsub(r->pool, process_tags(hdr, r), value, AP_MAX_REG_MATCH, pmatch);
653 if (hdr->action == hdr_edit) {
657 remainder = process_regexp(hdr, value + pmatch[0].rm_eo, r);
674 if (!ap_regexec(v->hdr->regex, key, 0, NULL, 0)) {
684 const char *repl = process_regexp(ed->hdr, val, ed->r);
708 header_entry *hdr = &((header_entry *) (fixup->elts))[i];
709 const char *envar = hdr->condition_var;
720 else if (hdr->expr != NULL) {
722 int eval = ap_expr_exec(r, hdr->expr, &err);
744 switch (hdr->action) {
746 apr_table_addn(headers, hdr->header, process_tags(hdr, r));
749 apr_table_mergen(headers, hdr->header, process_tags(hdr, r));
752 val = apr_table_get(headers, hdr->header);
754 apr_table_addn(headers, hdr->header, process_tags(hdr, r));
756 char *new_val = process_tags(hdr, r);
787 apr_table_mergen(headers, hdr->header, new_val);
792 if (!strcasecmp(hdr->header, "Content-Type")) {
793 ap_set_content_type(r, process_tags(hdr, r));
795 apr_table_setn(headers, hdr->header, process_tags(hdr, r));
798 if (NULL == apr_table_get(headers, hdr->header)) {
799 if (!strcasecmp(hdr->header, "Content-Type")) {
800 ap_set_content_type(r, process_tags(hdr, r));
802 apr_table_setn(headers, hdr->header, process_tags(hdr, r));
806 apr_table_unset(headers, hdr->header);
810 v.hdr = hdr;
816 if (!strcasecmp(hdr->header, "Content-Type") && r->content_type) {
817 const char *repl = process_regexp(hdr, r->content_type, r);
822 if (apr_table_get(headers, hdr->header)) {
826 ed.hdr = hdr;
829 hdr->header, NULL))
831 apr_table_unset(headers, hdr->header);
836 apr_table_setn(r->notes, process_tags(hdr, r), apr_table_get(headers, hdr->header));