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
4b9f7ce4
Commit
4b9f7ce4
authored
Jun 03, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix whitespace.
parent
4dc50186
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
vmod_re2.c
src/vmod_re2.c
+29
-29
No files found.
src/vmod_re2.c
View file @
4b9f7ce4
...
...
@@ -43,13 +43,13 @@
#include "vre2/vre2set.h"
#define ERR(ctx, msg) \
errmsg((ctx), "vmod re2 error: " msg)
errmsg((ctx), "vmod re2 error: " msg)
#define VERR(ctx, fmt, ...) \
errmsg((ctx), "vmod re2 error: " fmt, __VA_ARGS__)
errmsg((ctx), "vmod re2 error: " fmt, __VA_ARGS__)
#define VERRNOMEM(ctx, fmt, ...) \
VERR((ctx), fmt ", out of space", __VA_ARGS__)
VERR((ctx), fmt ", out of space", __VA_ARGS__)
#define INIT(ctx) (((ctx)->method & VCL_MET_INIT) != 0)
...
...
@@ -93,22 +93,22 @@ static const char * const rewrite_name[] = {
static
void
errmsg
(
VRT_CTX
,
const
char
*
fmt
,
...)
{
va_list
args
;
va_list
args
;
va_start
(
args
,
fmt
);
if
(
ctx
->
vsl
)
VSLbv
(
ctx
->
vsl
,
SLT_VCL_Error
,
fmt
,
args
);
else
VSLv
(
SLT_VCL_Error
,
0
,
fmt
,
args
);
va_end
(
args
);
va_start
(
args
,
fmt
);
if
(
ctx
->
vsl
)
VSLbv
(
ctx
->
vsl
,
SLT_VCL_Error
,
fmt
,
args
);
else
VSLv
(
SLT_VCL_Error
,
0
,
fmt
,
args
);
va_end
(
args
);
if
(
ctx
->
method
==
VCL_MET_INIT
)
{
AN
(
ctx
->
msg
);
if
(
ctx
->
method
==
VCL_MET_INIT
)
{
AN
(
ctx
->
msg
);
va_start
(
args
,
fmt
);
VSB_vprintf
(
ctx
->
msg
,
fmt
,
args
);
VSB_vprintf
(
ctx
->
msg
,
fmt
,
args
);
va_end
(
args
);
VRT_handling
(
ctx
,
VCL_RET_FAIL
);
}
VRT_handling
(
ctx
,
VCL_RET_FAIL
);
}
}
static
void
...
...
@@ -225,19 +225,19 @@ static VCL_STRING
namedref
(
VRT_CTX
,
vre2
*
restrict
vre2
,
VCL_STRING
name
,
VCL_STRING
fallback
,
void
*
const
restrict
groups
,
const
int
ngroups
)
{
int
refnum
;
const
char
*
err
;
if
((
err
=
vre2_get_group
(
vre2
,
name
,
&
refnum
))
!=
NULL
)
{
VERR
(
ctx
,
ERR_PREFIX
"%s"
,
name
,
fallback
,
err
);
return
fallback
;
}
if
(
refnum
==
-
1
)
{
VERR
(
ctx
,
ERR_PREFIX
"no such named group"
,
name
,
fallback
);
return
fallback
;
}
int
refnum
;
const
char
*
err
;
if
((
err
=
vre2_get_group
(
vre2
,
name
,
&
refnum
))
!=
NULL
)
{
VERR
(
ctx
,
ERR_PREFIX
"%s"
,
name
,
fallback
,
err
);
return
fallback
;
}
if
(
refnum
==
-
1
)
{
VERR
(
ctx
,
ERR_PREFIX
"no such named group"
,
name
,
fallback
);
return
fallback
;
}
assert
(
refnum
>
0
&&
refnum
<=
ngroups
);
return
backref
(
ctx
,
refnum
,
fallback
,
groups
,
ngroups
);
return
backref
(
ctx
,
refnum
,
fallback
,
groups
,
ngroups
);
}
#undef ERR_PREFIX
...
...
@@ -453,7 +453,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name,
if
(
re
->
never_capture
)
{
VERR
(
ctx
,
ERR_PREFIX
"never_capture is true for object %s"
,
re
->
vcl_name
,
name
,
fallback
,
re
->
vcl_name
);
re
->
vcl_name
,
name
,
fallback
,
re
->
vcl_name
);
return
fallback
;
}
...
...
@@ -466,7 +466,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name,
}
WS_Contains
(
ctx
->
ws
,
task
->
priv
,
sizeof
(
*
task_match
));
CAST_OBJ
(
task_match
,
task
->
priv
,
TASK_MATCH_MAGIC
);
return
namedref
(
ctx
,
re
->
vre2
,
name
,
fallback
,
task_match
->
groups
,
return
namedref
(
ctx
,
re
->
vre2
,
name
,
fallback
,
task_match
->
groups
,
re
->
ngroups
);
}
...
...
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