Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-selector
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-selector
Commits
19e75b64
Commit
19e75b64
authored
Jun 26, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify evaluation of the select ENUM.
parent
a43e7ab7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
vmod_selector.c
src/vmod_selector.c
+12
-8
No files found.
src/vmod_selector.c
View file @
19e75b64
...
...
@@ -429,16 +429,20 @@ select(VRT_CTX, const struct match_data * const restrict match,
const
char
*
const
restrict
obj
,
VCL_ENUM
const
restrict
selects
,
const
char
*
const
restrict
method
)
{
if
(
selects
==
vmod_enum_UNIQUE
)
{
if
(
match
->
n
!=
1
)
{
VERR
(
ctx
,
"%s.%s(select=UNIQUE): "
"%d elements were matched"
,
obj
,
method
,
match
->
n
);
return
(
UINT_MAX
);
}
if
(
selects
==
vmod_enum_EXACT
)
{
if
(
match
->
exact
==
UINT_MAX
)
VERR
(
ctx
,
"%s.%s(select=EXACT): "
"no element matched exactly"
,
obj
,
method
);
return
match
->
exact
;
}
if
(
match
->
n
==
1
)
return
match
->
indices
[
0
];
if
(
selects
==
vmod_enum_UNIQUE
)
{
VERR
(
ctx
,
"%s.%s(select=UNIQUE): %d elements were matched"
,
obj
,
method
,
match
->
n
);
return
(
UINT_MAX
);
}
if
(
selects
==
vmod_enum_EXACT
)
return
match
->
exact
;
if
(
selects
==
vmod_enum_FIRST
)
return
match
->
min
;
if
(
selects
==
vmod_enum_LAST
)
...
...
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