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
bf2b7a78
Commit
bf2b7a78
authored
May 16, 2017
by
Nils Goroll
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an off-by-one when copying the subject to the workspace
and add a test for it Fixes
#3
parent
6d85d03b
Pipeline
#209
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
b01.vtc
src/tests/b01.vtc
+7
-0
vmod_re.c
src/vmod_re.c
+1
-1
No files found.
src/tests/b01.vtc
View file @
bf2b7a78
...
@@ -6,12 +6,19 @@ server s1 {
...
@@ -6,12 +6,19 @@ server s1 {
} -start
} -start
varnish v1 -vcl+backend {
varnish v1 -vcl+backend {
import std;
import re from "${vmod_topbuild}/src/.libs/libvmod_re.so";
import re from "${vmod_topbuild}/src/.libs/libvmod_re.so";
sub vcl_init {
sub vcl_init {
new foobar = re.regex("foobar");
new foobar = re.regex("foobar");
new snafu = re.regex("snafu");
new snafu = re.regex("snafu");
new bar = re.regex("bar");
new bar = re.regex("bar");
if (bar.match("bar45678")) {
std.log(bar.backref(0, ""));
} else {
return (fail);
}
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/vmod_re.c
View file @
bf2b7a78
...
@@ -174,7 +174,7 @@ match(VRT_CTX, vre_t *vre, VCL_STRING subject, struct vmod_priv *task)
...
@@ -174,7 +174,7 @@ match(VRT_CTX, vre_t *vre, VCL_STRING subject, struct vmod_priv *task)
}
}
task
->
len
=
sizeof
(
*
ov
);
task
->
len
=
sizeof
(
*
ov
);
len
=
strlen
(
subject
);
len
=
strlen
(
subject
)
+
1
;
if
(
WS_Inside
(
ctx
->
ws
,
subject
,
subject
+
len
))
if
(
WS_Inside
(
ctx
->
ws
,
subject
,
subject
+
len
))
ov
->
subject
=
subject
;
ov
->
subject
=
subject
;
else
if
((
ov
->
subject
=
WS_Copy
(
ctx
->
ws
,
(
const
void
*
)
subject
,
len
))
else
if
((
ov
->
subject
=
WS_Copy
(
ctx
->
ws
,
(
const
void
*
)
subject
,
len
))
...
...
Geoff Simmons
@geoff
mentioned in commit
2c142833
·
May 16, 2017
mentioned in commit
2c142833
mentioned in commit 2c1428334cb9120e723475c31b99d4e0f58e63cb
Toggle commit list
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