Changeset 1621

Show
Ignore:
Timestamp:
07/08/08 13:37:00 (2 months ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r1618 r1621  
     12008-07-08  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/handler_redir.c (match_and_substitute): This changeset 
     4        covers a corner case, when neither the connection cache nor the 
     5        rule sub-entry have a regular expression to be evaluated. In this 
     6        case, we assume it matches the request. 
     7 
    182008-07-07  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
    29 
  • cherokee/trunk/cherokee/handler_redir.c

    r1614 r1621  
    110110         */ 
    111111        list_for_each (i, &HDL_REDIR_PROPS(n)->regex_list) { 
    112                 cint_t           rc
     112                cint_t           rc = 0
    113113                char            *subject;  
    114114                cint_t           subject_len; 
     
    130130                subject_len = strlen (subject); 
    131131 
    132                 /* It might be matched previosly in the request parsing.. 
    133                  */ 
    134                 if (list->re == NULL) { 
    135                         memcpy (ovector,  
     132                /* Case 1: No conn substitution, No local regex 
     133                 */ 
     134                if ((list->re == NULL) && 
     135                    (conn->regex_match_ovector == NULL)) 
     136                { 
     137                        TRACE (ENTRIES, "Using conn->ovector, size=%d\n", rc); 
     138                }  
     139 
     140                /* Case 2: Cached conn substitution 
     141                 */ 
     142                else if (list->re == NULL) { 
     143                        memcpy (ovector, 
    136144                                conn->regex_match_ovector, 
    137                                 OVECTOR_LEN * sizeof(int)); 
    138  
     145                                OVECTOR_LEN * sizeof(cint_t)); 
     146                         
    139147                        rc = *conn->regex_match_ovecsize; 
    140148                        TRACE (ENTRIES, "Using conn->ovector, size=%d\n", rc); 
    141  
    142                 } else { 
     149                }  
     150 
     151                /* Case 3: Use the rule-subentry regex 
     152                 */ 
     153                else { 
    143154                        rc = pcre_exec (list->re, NULL, subject, subject_len, 0, 0, ovector, OVECTOR_LEN); 
    144155                        if (rc == 0) {