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
6b0c55b7
Commit
6b0c55b7
authored
Jul 13, 2020
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a BASE64 class to VCT
parent
50a59f10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
vct.h
include/vct.h
+2
-0
vct.c
lib/libvarnish/vct.c
+15
-15
No files found.
include/vct.h
View file @
6b0c55b7
...
...
@@ -47,6 +47,7 @@
#define VCT_TCHAR (1<<9)
#define VCT_ID (1<<10)
#define VCT_IDENT (VCT_ALPHA | VCT_DIGIT | VCT_ID)
#define VCT_BASE64 (1<<11)
#define VCT_VT (1<<12)
#define VCT_SPACE (VCT_LWS | VCT_VT)
#define VCT_UPPER (1<<13)
...
...
@@ -75,6 +76,7 @@ vct_is(int x, uint16_t y)
#define vct_islower(x) vct_is(x, VCT_LOWER)
#define vct_isupper(x) vct_is(x, VCT_UPPER)
#define vct_isalnum(x) vct_is(x, VCT_ALPHA | VCT_DIGIT)
#define vct_isbase64(x) vct_is(x, VCT_BASE64)
#define vct_issep(x) vct_is(x, VCT_SEPARATOR)
#define vct_issepctl(x) vct_is(x, VCT_SEPARATOR | VCT_CTL)
#define vct_isident1(x) vct_isalpha(x)
...
...
lib/libvarnish/vct.c
View file @
6b0c55b7
...
...
@@ -43,8 +43,8 @@
/* NB: VCT always operate in ASCII, don't replace 0x0d with \r etc. */
#define VCT_UPALPHA (VCT_ALPHA | VCT_UPPER)
#define VCT_LOALPHA (VCT_ALPHA | VCT_LOWER)
#define VCT_UPALPHA (VCT_ALPHA | VCT_UPPER
| VCT_BASE64
)
#define VCT_LOALPHA (VCT_ALPHA | VCT_LOWER
| VCT_BASE64
)
const
uint16_t
vct_typtab
[
256
]
=
{
[
0x00
]
=
VCT_CTL
,
...
...
@@ -90,25 +90,25 @@ const uint16_t vct_typtab[256] = {
[
0x28
]
=
VCT_SEPARATOR
,
[
0x29
]
=
VCT_SEPARATOR
,
[
0x2a
]
=
VCT_TCHAR
,
[
0x2b
]
=
VCT_TCHAR
,
[
0x2b
]
=
VCT_TCHAR
|
VCT_BASE64
,
[
0x2c
]
=
VCT_SEPARATOR
,
[
0x2d
]
=
VCT_XMLNAME
|
VCT_TCHAR
|
VCT_ID
,
[
0x2e
]
=
VCT_XMLNAME
|
VCT_TCHAR
,
[
0x2f
]
=
VCT_SEPARATOR
,
[
0x30
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x31
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x32
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x33
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x34
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x35
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x36
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x37
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x38
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x39
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
,
[
0x2f
]
=
VCT_SEPARATOR
|
VCT_BASE64
,
[
0x30
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x31
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x32
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x33
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x34
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x35
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x36
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x37
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x38
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x39
]
=
VCT_DIGIT
|
VCT_HEX
|
VCT_XMLNAME
|
VCT_BASE64
,
[
0x3a
]
=
VCT_SEPARATOR
|
VCT_XMLNAMESTART
,
[
0x3b
]
=
VCT_SEPARATOR
,
[
0x3c
]
=
VCT_SEPARATOR
,
[
0x3d
]
=
VCT_SEPARATOR
,
[
0x3d
]
=
VCT_SEPARATOR
|
VCT_BASE64
,
[
0x3e
]
=
VCT_SEPARATOR
,
[
0x3f
]
=
VCT_SEPARATOR
,
[
0x40
]
=
VCT_SEPARATOR
,
...
...
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