Changeset 1684
- Timestamp:
- 07/25/08 11:45:06 (6 months ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/connection-protected.h (modified) (2 diffs)
- cherokee/trunk/cherokee/connection.c (modified) (3 diffs)
- cherokee/trunk/cherokee/handler_redir.c (modified) (2 diffs)
- cherokee/trunk/cherokee/rule_request.c (modified) (2 diffs)
- cherokee/trunk/cherokee/rule_request.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r1683 r1684 1 2008-07-25 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * cherokee/handler_redir.c, cherokee/rule_request.c, 4 cherokee/rule_request.h, cherokee/connection-protected.h, 5 cherokee/connection.c: Fixes a concurrency issue. There were a few 6 values that were stored within a common structure. This may end up 7 leading the server to build wrong redirection addresses. 8 1 9 2008-07-23 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 10 cherokee/trunk/cherokee/connection-protected.h
r1673 r1684 62 62 #include "post.h" 63 63 #include "header-protected.h" 64 64 #include "regex.h" 65 65 66 66 typedef enum { … … 183 183 cherokee_iocache_entry_t *io_entry_ref; 184 184 185 int *regex_match_ovector;186 int *regex_match_ovecsize;185 int regex_ovector[OVECTOR_LEN]; 186 int regex_ovecsize; 187 187 }; 188 188 cherokee/trunk/cherokee/connection.c
r1680 r1684 115 115 n->traffic_next = 0; 116 116 n->validator = NULL; 117 n->regex_match_ovector = NULL;118 n->regex_match_ovecsize = NULL;119 117 n->timeout = -1; 120 118 n->polling_fd = -1; … … 142 140 cherokee_header_init (&n->header, header_type_request); 143 141 cherokee_post_init (&n->post); 142 143 memset (n->regex_ovector, OVECTOR_LEN * sizeof(int), 0); 144 n->regex_ovecsize = 0; 144 145 145 146 *conn = n; … … 233 234 conn->tx_partial = 0; 234 235 conn->traffic_next = 0; 235 conn->regex_match_ovector = NULL;236 conn->regex_match_ovecsize = NULL;237 236 conn->polling_multiple = false; 237 238 memset (conn->regex_ovector, OVECTOR_LEN * sizeof(int), 0); 239 conn->regex_ovecsize = 0; 238 240 239 241 if (conn->handler != NULL) { cherokee/trunk/cherokee/handler_redir.c
r1621 r1684 133 133 */ 134 134 if ((list->re == NULL) && 135 (conn->regex_ match_ovector == NULL))135 (conn->regex_ovecsize == 0)) 136 136 { 137 TRACE (ENTRIES, "Using conn->ovector, size=%d\n", rc); 137 TRACE (ENTRIES, "Using conn->ovector, size=%d\n", 138 conn->regex_ovecsize); 138 139 } 139 140 … … 142 143 else if (list->re == NULL) { 143 144 memcpy (ovector, 144 conn->regex_ match_ovector,145 conn->regex_ovector, 145 146 OVECTOR_LEN * sizeof(cint_t)); 146 147 147 rc = *conn->regex_match_ovecsize;148 rc = conn->regex_ovecsize; 148 149 TRACE (ENTRIES, "Using conn->ovector, size=%d\n", rc); 149 150 } cherokee/trunk/cherokee/rule_request.c
r1614 r1684 68 68 conn->request.len, 69 69 0, 0, 70 rule->ovector, OVECTOR_LEN);70 conn->regex_ovector, OVECTOR_LEN); 71 71 72 72 if (re < 0) { … … 78 78 } 79 79 80 rule->ovecsize = re;80 conn->regex_ovecsize = re; 81 81 82 82 TRACE (ENTRIES, "Request \"%s\" matches with \"%s\", ovecsize=%d\n", 83 conn->request.buf, rule->pattern.buf, rule->ovecsize); 84 85 /* Store a pointer to the rule. We might want to use 86 * rule->ovectors from handler_redir later on. 87 */ 88 conn->regex_match_ovector = &rule->ovector[0]; 89 conn->regex_match_ovecsize = &rule->ovecsize; 83 conn->request.buf, rule->pattern.buf, conn->regex_ovecsize); 90 84 91 85 ret = ret_ok; cherokee/trunk/cherokee/rule_request.h
r1398 r1684 39 39 typedef struct { 40 40 cherokee_rule_t rule; 41 42 int ovector[OVECTOR_LEN];43 int ovecsize;44 41 void *pcre; 45 42 cherokee_buffer_t pattern;