Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
3d43f62b
Commit
3d43f62b
authored
Jan 02, 2012
by
Tollef Fog Heen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for banning on http.status
Fixes: #1076
parent
a4e2d478
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
cache_ban.c
bin/varnishd/cache/cache_ban.c
+9
-3
ban_vars.h
include/tbl/ban_vars.h
+1
-0
No files found.
bin/varnishd/cache/cache_ban.c
View file @
3d43f62b
...
...
@@ -113,9 +113,10 @@ static bgthread_t ban_lurker;
#define BAN_OPER_MATCH 0x12
#define BAN_OPER_NMATCH 0x13
#define BAN_ARG_URL 0x18
#define BAN_ARG_REQHTTP 0x19
#define BAN_ARG_OBJHTTP 0x1a
#define BAN_ARG_URL 0x18
#define BAN_ARG_REQHTTP 0x19
#define BAN_ARG_OBJHTTP 0x1a
#define BAN_ARG_OBJSTATUS 0x1b
/*--------------------------------------------------------------------
* Variables we can purge on
...
...
@@ -609,6 +610,7 @@ ban_evaluate(const uint8_t *bs, const struct http *objhttp,
struct
ban_test
bt
;
const
uint8_t
*
be
;
char
*
arg1
;
char
buf
[
10
];
be
=
bs
+
ban_len
(
bs
);
bs
+=
13
;
...
...
@@ -628,6 +630,10 @@ ban_evaluate(const uint8_t *bs, const struct http *objhttp,
case
BAN_ARG_OBJHTTP
:
(
void
)
http_GetHdr
(
objhttp
,
bt
.
arg1_spec
,
&
arg1
);
break
;
case
BAN_ARG_OBJSTATUS
:
arg1
=
buf
;
sprintf
(
buf
,
"%d"
,
objhttp
->
status
);
break
;
default:
INCOMPL
();
}
...
...
include/tbl/ban_vars.h
View file @
3d43f62b
...
...
@@ -35,3 +35,4 @@
PVAR
(
"req.url"
,
PVAR_REQ
,
BAN_ARG_URL
)
PVAR
(
"req.http."
,
PVAR_REQ
|
PVAR_HTTP
,
BAN_ARG_REQHTTP
)
PVAR
(
"obj.http."
,
PVAR_HTTP
,
BAN_ARG_OBJHTTP
)
PVAR
(
"obj.status"
,
0
,
BAN_ARG_OBJSTATUS
)
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