Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
2766a700
Commit
2766a700
authored
Oct 07, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Think about and document how we encode bans into bytestrings.
parent
c327e765
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
cache_ban.c
bin/varnishd/cache_ban.c
+20
-2
No files found.
bin/varnishd/cache_ban.c
View file @
2766a700
...
...
@@ -38,6 +38,26 @@
* We make the "&&" mandatory from the start, leaving the syntax space
* for latter handling of "||" as well.
*
* Bans are compiled into bytestrings as follows:
* 8 bytes - double: timestamp XXX: Byteorder ?
* 4 bytes - be32: length
* 1 byte - flags: 0x01: BAN_F_REQ
* N tests
* A test have this form:
* 1 byte - arg (see ban_vars.h col 3 "BAN_ARG_XXX")
* (n bytes) - http header name, canonical encoding
* lump - comparison arg
* 1 byte - operation (BAN_OPER_)
* (lump) - compiled regexp
* A lump is:
* 4 bytes - be32: length
* n bytes - content
*
* In a perfect world, we should vector through VRE to get to PCRE,
* but since we rely on PCRE's ability to encode the regexp into a
* byte string, that would be a little bit artificial, so this is
* the exception that confirmes the rule.
*
*/
#include "config.h"
...
...
@@ -286,8 +306,6 @@ ban_parse_http(const struct ban *b, const char *a1)
/*--------------------------------------------------------------------
* Parse and add a ban test specification
*
* XXX: This should vector through VRE.
*/
static
int
...
...
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