[njs] Ignoring pcre_study() error.

Valentin Bartenev vbart at nginx.com
Fri Nov 20 09:32:49 UTC 2020


details:   https://hg.nginx.org/njs/rev/e51da8c71f26
branches:  
changeset: 1569:e51da8c71f26
user:      Valentin Bartenev <vbart at nginx.com>
date:      Fri Nov 20 12:29:30 2020 +0300
description:
Ignoring pcre_study() error.

It provides optional optimization that shouldn't be fatal for regex compilation.

diffstat:

 src/njs_pcre.c |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (15 lines):

diff -r c947a300b96c -r e51da8c71f26 src/njs_pcre.c
--- a/src/njs_pcre.c	Wed Nov 18 18:09:11 2020 +0000
+++ b/src/njs_pcre.c	Fri Nov 20 12:29:30 2020 +0300
@@ -94,10 +94,8 @@ njs_regex_compile(njs_regex_t *regex, u_
     regex->extra = pcre_study(regex->code, 0, &errstr);
 
     if (njs_slow_path(errstr != NULL)) {
-        njs_alert(ctx->trace, NJS_LEVEL_ERROR,
+        njs_alert(ctx->trace, NJS_LEVEL_WARN,
                   "pcre_study(\"%s\") failed: %s", pattern, errstr);
-
-        goto done;
     }
 
     err = pcre_fullinfo(regex->code, NULL, PCRE_INFO_CAPTURECOUNT,


More information about the nginx-devel mailing list