Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-pcre2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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-pcre2
Commits
c6901806
Commit
c6901806
authored
Jun 29, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take get_match_opts() out of the fast path entirely.
parent
25beb0c3
Pipeline
#262
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
pcre2.c
src/pcre2.c
+0
-5
vmod_pcre2.c
src/vmod_pcre2.c
+26
-15
No files found.
src/pcre2.c
View file @
c6901806
...
...
@@ -245,11 +245,6 @@ get_match_opts(VRT_CTX, struct vmod_priv *priv, MATCH_CTX_OPTS, MATCH_FLAGS,
struct
match_call
*
match_opts
;
pcre2_match_context
*
mctx
;
if
(
priv
->
priv
!=
NULL
)
{
CAST_OBJ
(
match_opts
,
priv
->
priv
,
VMOD_PCRE2_MATCH_CALL_MAGIC
);
return
match_opts
;
}
if
(
!
check_uint32_range
(
ctx
,
match_limit
,
"match_limit"
,
context
,
caller
))
return
NULL
;
...
...
src/vmod_pcre2.c
View file @
c6901806
...
...
@@ -386,10 +386,13 @@ vmod_regex_match(VRT_CTX, struct vmod_pcre2_regex *regex,
/* The match context and options are PRIV_CALL-scoped. */
/* XXX param to decide whether these should be saved for the call */
match_opts
=
get_match_opts
(
ctx
,
priv_call
,
MATCH_CTX_PARAMS
,
MATCH_FLAGS_PARAMS
,
regex
->
vcl_name
,
".match()"
);
if
(
match_opts
==
NULL
)
if
(
priv_call
->
priv
!=
NULL
)
CAST_OBJ
(
match_opts
,
priv_call
->
priv
,
VMOD_PCRE2_MATCH_CALL_MAGIC
);
else
if
((
match_opts
=
get_match_opts
(
ctx
,
priv_call
,
MATCH_CTX_PARAMS
,
MATCH_FLAGS_PARAMS
,
regex
->
vcl_name
,
".match()"
))
==
NULL
)
return
0
;
/* The match data block is task-scoped for this object only. */
...
...
@@ -468,11 +471,14 @@ vmod_regex_sub(VRT_CTX, struct vmod_pcre2_regex *regex,
return
NULL
;
}
match_opts
=
get_match_opts
(
ctx
,
priv_call
,
MATCH_CTX_PARAMS
,
MATCH_SUB_FLAGS_PARAMS
,
regex
->
vcl_name
,
".match()"
);
if
(
match_opts
==
NULL
)
return
0
;
if
(
priv_call
->
priv
!=
NULL
)
CAST_OBJ
(
match_opts
,
priv_call
->
priv
,
VMOD_PCRE2_MATCH_CALL_MAGIC
);
else
if
((
match_opts
=
get_match_opts
(
ctx
,
priv_call
,
MATCH_CTX_PARAMS
,
MATCH_SUB_FLAGS_PARAMS
,
regex
->
vcl_name
,
".sub()"
))
==
NULL
)
return
NULL
;
return
sub
(
ctx
,
subject
,
replacement
,
len
,
priv_task
,
regex
->
code
,
match_opts
,
regex
->
vcl_name
);
...
...
@@ -499,9 +505,11 @@ vmod_match(VRT_CTX, struct vmod_priv *call, struct vmod_priv *task,
/* Compile and match options saved in PRIV_CALL scope */
/* XXX need a lock */
match_call
=
get_match_opts
(
ctx
,
call
,
MATCH_CTX_PARAMS
,
MATCH_FLAGS_PARAMS
,
"pcre2"
,
".match()"
);
if
(
match_call
==
NULL
)
if
(
call
->
priv
!=
NULL
)
CAST_OBJ
(
match_call
,
call
->
priv
,
VMOD_PCRE2_MATCH_CALL_MAGIC
);
else
if
((
match_call
=
get_match_opts
(
ctx
,
call
,
MATCH_CTX_PARAMS
,
MATCH_FLAGS_PARAMS
,
"pcre2"
,
".match()"
))
==
NULL
)
return
0
;
if
(
match_call
->
cctx
==
NULL
)
{
match_call
->
cctx
...
...
@@ -604,9 +612,12 @@ vmod_sub(VRT_CTX, struct vmod_priv *priv_call, struct vmod_priv *priv_task,
return
NULL
;
}
match_opts
=
get_match_opts
(
ctx
,
priv_call
,
MATCH_CTX_PARAMS
,
MATCH_SUB_FLAGS_PARAMS
,
"pcre2"
,
".sub()"
);
if
(
match_opts
==
NULL
)
if
(
priv_call
->
priv
!=
NULL
)
CAST_OBJ
(
match_opts
,
priv_call
->
priv
,
VMOD_PCRE2_MATCH_CALL_MAGIC
);
else
if
((
match_opts
=
get_match_opts
(
ctx
,
priv_call
,
MATCH_CTX_PARAMS
,
MATCH_SUB_FLAGS_PARAMS
,
"pcre2"
,
".sub()"
))
==
NULL
)
return
0
;
if
(
match_opts
->
cctx
==
NULL
)
{
match_opts
->
cctx
...
...
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