httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r960677 - /httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c
Date Mon, 05 Jul 2010 19:59:13 GMT
Author: niq
Date: Mon Jul  5 19:59:13 2010
New Revision: 960677

URL: http://svn.apache.org/viewvc?rev=960677&view=rev
Log:
Undo accidental commit of code in r960674

Modified:
    httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c

Modified: httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c?rev=960677&r1=960676&r2=960677&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c (original)
+++ httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c Mon Jul  5 19:59:13 2010
@@ -94,8 +94,7 @@ typedef enum {
     hdr_merge = 'g',            /* merge (merge, but avoid duplicates) */
     hdr_unset = 'u',            /* unset header */
     hdr_echo = 'e',             /* echo headers from request to response */
-    hdr_edit = 'r',             /* change value by regexp, match once */
-    hdr_edit_r = 'R'            /* change value by regexp, everymatch */
+    hdr_edit = 'r'              /* change value by regexp */
 } hdr_actions;
 
 /*
@@ -365,7 +364,6 @@ static char *parse_format_string(apr_poo
     /* No string to parse with unset and echo commands */
     if (hdr->action == hdr_unset ||
         hdr->action == hdr_edit ||
-        hdr->action == hdr_edit_r ||
         hdr->action == hdr_echo) {
         return NULL;
     }
@@ -415,13 +413,11 @@ static APR_INLINE const char *header_ino
         new->action = hdr_echo;
     else if (!strcasecmp(action, "edit"))
         new->action = hdr_edit;
-    else if (!strcasecmp(action, "edit*"))
-        new->action = hdr_edit_r;
     else
         return "first argument must be 'add', 'set', 'append', 'merge', "
-               "'unset', 'echo', 'edit', or 'edit*'.";
+               "'unset', 'echo', or 'edit'.";
 
-    if (new->action == hdr_edit || new->action == hdr_edit_r) {
+    if (new->action == hdr_edit) {
         if (subs == NULL) {
             return "Header edit requires a match and a substitution";
         }
@@ -562,7 +558,6 @@ static const char *process_regexp(header
     unsigned int nmatch = 10;
     ap_regmatch_t pmatch[10];
     const char *subs;
-    const char *remainder;
     char *ret;
     int diffsz;
     if (ap_regexec(hdr->regex, value, nmatch, pmatch, 0)) {
@@ -571,13 +566,6 @@ static const char *process_regexp(header
     }
     subs = ap_pregsub(pool, hdr->subs, value, nmatch, pmatch);
     diffsz = strlen(subs) - (pmatch[0].rm_eo - pmatch[0].rm_so);
-    if (hdr->action == hdr_edit) {
-        remainder = value + pmatch[0].rm_eo;
-    }
-    else { /* recurse to edit multiple matches if applicable */
-        remainder = process_regexp(hdr, value + pmatch[0].rm_eo, pool);
-        diffsz += strlen(remainder) - strlen(value + pmatch[0].rm_eo);
-    }
     ret = apr_palloc(pool, strlen(value) + 1 + diffsz);
     memcpy(ret, value, pmatch[0].rm_so);
     strcpy(ret + pmatch[0].rm_so, subs);
@@ -707,7 +695,6 @@ static void do_headers_fixup(request_rec
                          echo_header, (void *) &v, r->headers_in, NULL);
             break;
         case hdr_edit:
-        case hdr_edit_r:
             if (apr_table_get(headers, hdr->header)) {
                 edit_do ed;
 



Mime
View raw message