Feature #2361 » lighttpd_pcrejit.patch
src/data_config.c (working copy) | ||
---|---|---|
if (ds->string) buffer_free(ds->string);
|
||
#ifdef HAVE_PCRE_H
|
||
if (ds->regex) pcre_free(ds->regex);
|
||
if (ds->regex_study) pcre_free(ds->regex_study);
|
||
if (ds->regex_study) {
|
||
#ifdef PCRE_CONFIG_JIT
|
||
pcre_free_study(ds->regex_study);
|
||
#else
|
||
pcre_free(ds->regex_study);
|
||
#endif
|
||
}
|
||
#endif
|
||
free(d);
|
||
}
|
src/configparser.y (working copy) | ||
---|---|---|
#ifdef HAVE_PCRE_H
|
||
const char *errptr;
|
||
int erroff, captures;
|
||
#ifdef PCRE_STUDY_JIT_COMPILE
|
||
static int study_options = PCRE_STUDY_JIT_COMPILE;
|
||
#else
|
||
static int study_options = 0;
|
||
#endif
|
||
if (NULL == (dc->regex =
|
||
pcre_compile(rvalue->ptr, 0, &errptr, &erroff, NULL))) {
|
||
... | ... | |
ctx->ok = 0;
|
||
} else if (NULL == (dc->regex_study =
|
||
pcre_study(dc->regex, 0, &errptr)) &&
|
||
pcre_study(dc->regex, study_options, &errptr)) &&
|
||
errptr != NULL) {
|
||
fprintf(stderr, "studying regex failed: %s -> %s\n",
|
||
rvalue->ptr, errptr);
|
src/keyvalue.c (working copy) | ||
---|---|---|
const char *errptr;
|
||
int erroff;
|
||
pcre_keyvalue *kv;
|
||
#ifdef PCRE_STUDY_JIT_COMPILE
|
||
static int study_options = PCRE_STUDY_JIT_COMPILE;
|
||
#else
|
||
static int study_options = 0;
|
||
#endif
|
||
#endif
|
||
if (!key) return -1;
|
||
... | ... | |
return -1;
|
||
}
|
||
if (NULL == (kv->key_extra = pcre_study(kv->key, 0, &errptr)) &&
|
||
if (NULL == (kv->key_extra = pcre_study(kv->key, study_options, &errptr)) &&
|
||
errptr != NULL) {
|
||
return -1;
|
||
}
|
||
... | ... | |
for (i = 0; i < kvb->size; i++) {
|
||
kv = kvb->kv[i];
|
||
if (kv->key) pcre_free(kv->key);
|
||
if (kv->key_extra) pcre_free(kv->key_extra);
|
||
if (kv->key_extra) {
|
||
#ifdef PCRE_STUDY_JIT_COMPILE
|
||
pcre_free_study(kv->key_extra);
|
||
#else
|
||
pcre_free(kv->key_extra);
|
||
#endif
|
||
}
|
||
if (kv->value) buffer_free(kv->value);
|
||
free(kv);
|
||
}
|