comparison src/core/ngx_regex.c @ 4711:7cb78d9289b8 stable-1.2

Merge of r4639, r4640: C++ fixes. Fixed the ngx_regex.h header file compatibility with C++. Fixed building --with-cpp_test_module on some systems.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 29 Jun 2012 17:32:43 +0000
parents 196c3dacff0d
children e7f6991eca47
comparison
equal deleted inserted replaced
4710:5a4666d4b6cb 4711:7cb78d9289b8
150 rc->regex = ngx_pcalloc(rc->pool, sizeof(ngx_regex_t)); 150 rc->regex = ngx_pcalloc(rc->pool, sizeof(ngx_regex_t));
151 if (rc->regex == NULL) { 151 if (rc->regex == NULL) {
152 return NGX_ERROR; 152 return NGX_ERROR;
153 } 153 }
154 154
155 rc->regex->pcre = re; 155 rc->regex->code = re;
156 156
157 /* do not study at runtime */ 157 /* do not study at runtime */
158 158
159 if (ngx_pcre_studies != NULL) { 159 if (ngx_pcre_studies != NULL) {
160 elt = ngx_list_push(ngx_pcre_studies); 160 elt = ngx_list_push(ngx_pcre_studies);
365 part = part->next; 365 part = part->next;
366 elts = part->elts; 366 elts = part->elts;
367 i = 0; 367 i = 0;
368 } 368 }
369 369
370 elts[i].regex->extra = pcre_study(elts[i].regex->pcre, opt, &errstr); 370 elts[i].regex->extra = pcre_study(elts[i].regex->code, opt, &errstr);
371 371
372 if (errstr != NULL) { 372 if (errstr != NULL) {
373 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, 373 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
374 "pcre_study() failed: %s in \"%s\"", 374 "pcre_study() failed: %s in \"%s\"",
375 errstr, elts[i].name); 375 errstr, elts[i].name);
378 #if (NGX_HAVE_PCRE_JIT) 378 #if (NGX_HAVE_PCRE_JIT)
379 if (opt & PCRE_STUDY_JIT_COMPILE) { 379 if (opt & PCRE_STUDY_JIT_COMPILE) {
380 int jit, n; 380 int jit, n;
381 381
382 jit = 0; 382 jit = 0;
383 n = pcre_fullinfo(elts[i].regex->pcre, elts[i].regex->extra, 383 n = pcre_fullinfo(elts[i].regex->code, elts[i].regex->extra,
384 PCRE_INFO_JIT, &jit); 384 PCRE_INFO_JIT, &jit);
385 385
386 if (n != 0 || jit != 1) { 386 if (n != 0 || jit != 1) {
387 ngx_log_error(NGX_LOG_INFO, cycle->log, 0, 387 ngx_log_error(NGX_LOG_INFO, cycle->log, 0,
388 "JIT compiler does not support pattern: \"%s\"", 388 "JIT compiler does not support pattern: \"%s\"",