Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-re
Commits
b64ab317
Unverified
Commit
b64ab317
authored
Jul 20, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save ultimate match result as either the lowest error ...
... or the highest match
parent
38fd9c23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
vmod_re.c
src/vmod_re.c
+8
-7
No files found.
src/vmod_re.c
View file @
b64ab317
...
...
@@ -489,6 +489,7 @@ struct re_iter_priv {
#define RE_ITER_PRIV_MAGIC 0x04383ab8
uint32_t
options
;
int
s
;
int
ret
;
VRT_CTX
;
const
vre_t
*
vre
;
PCRE2_SIZE
startoffset
;
...
...
@@ -548,6 +549,10 @@ reip_iter(struct re_iter_priv *reip, unsigned flush,
reip
->
startoffset
,
reip
->
options
,
reip
->
task
,
reip
->
vre_limits
);
if
((
reip
->
s
<
PCRE2_ERROR_NOMATCH
&&
reip
->
s
<
reip
->
ret
)
||
reip
->
s
>
reip
->
ret
)
reip
->
ret
=
reip
->
s
;
#ifdef ITERDBG
VSLb
(
reip
->
ctx
->
vsl
,
SLT_Debug
,
"match=%d, subject=%.*s, len=%zd"
,
reip
->
s
,
len
,
subject
,
len
);
...
...
@@ -643,6 +648,7 @@ reip_match_body(struct re_iter_priv *reip, struct vmod_re_regex *re,
VRT_CTX
;
struct
vmod_priv
*
task
;
uint32_t
u
;
int
r
;
CHECK_OBJ_NOTNULL
(
reip
,
RE_ITER_PRIV_MAGIC
);
CHECK_OBJ_NOTNULL
(
re
,
VMOD_RE_REGEX_MAGIC
);
...
...
@@ -715,14 +721,9 @@ reip_match_body(struct re_iter_priv *reip, struct vmod_re_regex *re,
assert
(
reip
->
s
!=
PCRE2_ERROR_PARTIAL
);
if
(
reip
->
s
>
PCRE2_ERROR_NOMATCH
)
{
memset
(
reip
,
0
,
sizeof
*
reip
);
return
(
1
);
}
// errror or no match
r
=
reip
->
ret
;
memset
(
reip
,
0
,
sizeof
*
reip
);
return
(
0
);
return
(
r
);
}
VCL_BOOL
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment