Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re2
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-re2
Commits
c7583ca9
Commit
c7583ca9
authored
Jun 05, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update use of the WS_* interface for compatibility with Varnish since 5.1.0.
parent
0da78435
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
vmod_re2.c
src/vmod_re2.c
+7
-5
No files found.
src/vmod_re2.c
View file @
c7583ca9
...
...
@@ -139,6 +139,7 @@ match(VRT_CTX, vre2 * restrict vre2, VCL_STRING restrict subject,
int
match
=
0
,
len
;
const
char
*
err
;
char
*
text
=
(
void
*
)
subject
;
uintptr_t
snap
;
AN
(
groups
);
if
(
subject
==
NULL
)
...
...
@@ -146,6 +147,7 @@ match(VRT_CTX, vre2 * restrict vre2, VCL_STRING restrict subject,
len
=
strlen
(
subject
);
*
groups
=
NULL
;
snap
=
WS_Snapshot
(
ctx
->
ws
);
if
(
!
never_capture
)
{
ngroups
++
;
if
((
text
=
WS_Copy
(
ctx
->
ws
,
subject
,
len
+
1
))
==
NULL
)
{
...
...
@@ -157,7 +159,7 @@ match(VRT_CTX, vre2 * restrict vre2, VCL_STRING restrict subject,
==
NULL
)
{
VERR
(
ctx
,
ERR_PREFIX
"insufficient workspace to "
"allocate match data"
,
subject
);
WS_Reset
(
ctx
->
ws
,
text
);
WS_Reset
(
ctx
->
ws
,
snap
);
return
0
;
}
}
...
...
@@ -166,14 +168,14 @@ match(VRT_CTX, vre2 * restrict vre2, VCL_STRING restrict subject,
!=
NULL
)
{
VERR
(
ctx
,
ERR_PREFIX
"%s"
,
subject
,
err
);
if
(
!
never_capture
)
WS_Reset
(
ctx
->
ws
,
text
);
WS_Reset
(
ctx
->
ws
,
snap
);
return
0
;
}
if
(
!
match
)
{
*
groups
=
(
void
*
)
match_failed
;
if
(
!
never_capture
)
WS_Reset
(
ctx
->
ws
,
text
);
WS_Reset
(
ctx
->
ws
,
snap
);
}
return
match
;
}
...
...
@@ -263,7 +265,7 @@ rewritef(VRT_CTX, vre2 * restrict vre2, const rewrite_e mode, VCL_STRING text,
char
*
ret
;
const
char
*
err
;
ret
=
WS_
Snapsho
t
(
ctx
->
ws
);
ret
=
WS_
Fron
t
(
ctx
->
ws
);
bytes
=
WS_Reserve
(
ctx
->
ws
,
0
);
if
(
bytes
==
0
)
{
VERR
(
ctx
,
ERR_PREFIX
"workspace overflow"
,
rewrite_name
[
mode
],
...
...
@@ -705,7 +707,7 @@ vmod_set_match(VRT_CTX, struct vmod_re2_set *set, VCL_STRING subject)
CAST_OBJ
(
task
,
priv
->
priv
,
TASK_SET_MATCH_MAGIC
);
}
buf
=
WS_
Snapsho
t
(
ctx
->
ws
);
buf
=
WS_
Fron
t
(
ctx
->
ws
);
buflen
=
WS_Reserve
(
ctx
->
ws
,
0
);
if
((
err
=
vre2set_match
(
set
->
set
,
subject
,
&
match
,
buf
,
buflen
,
&
task
->
nmatches
))
!=
NULL
)
{
...
...
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