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
22480f2e
Commit
22480f2e
authored
Dec 10, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
straighten out the rest of the blob vmod enum handling
parent
38f712a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
20 deletions
+25
-20
Makefile.am
lib/libvmod_blob/Makefile.am
+2
-1
tbl_case.h
lib/libvmod_blob/tbl_case.h
+8
-0
vmod_blob.c
lib/libvmod_blob/vmod_blob.c
+9
-9
vmod_blob.h
lib/libvmod_blob/vmod_blob.h
+6
-10
No files found.
lib/libvmod_blob/Makefile.am
View file @
22480f2e
...
@@ -11,7 +11,8 @@ libvmod_blob_la_SOURCES = \
...
@@ -11,7 +11,8 @@ libvmod_blob_la_SOURCES = \
url.c
\
url.c
\
wb.h
\
wb.h
\
wb.c
\
wb.c
\
tbl_encodings.h
tbl_encodings.h
\
tbl_case.h
base64.o
:
base64.c base64.h
base64.o
:
base64.c base64.h
...
...
lib/libvmod_blob/tbl_case.h
0 → 100644
View file @
22480f2e
/*
* this order MUST be preserved, since enum case_e LOWER and UPPER are used to
* index the array of cached encodings for the blob object.
*/
VMODENUM
(
LOWER
)
VMODENUM
(
UPPER
)
VMODENUM
(
DEFAULT
)
#undef VMODENUM
lib/libvmod_blob/vmod_blob.c
View file @
22480f2e
...
@@ -124,6 +124,15 @@ parse_encoding(VCL_ENUM e)
...
@@ -124,6 +124,15 @@ parse_encoding(VCL_ENUM e)
WRONG
(
"illegal encoding enum"
);
WRONG
(
"illegal encoding enum"
);
}
}
static
enum
case_e
parse_case
(
VCL_ENUM
e
)
{
#define VMODENUM(n) if (e == vmod_enum_ ## n) return(n);
#include "tbl_case.h"
WRONG
(
"illegal case enum"
);
}
static
inline
size_t
static
inline
size_t
decode_l_va
(
enum
encoding
dec
,
const
char
*
const
p
,
va_list
ap
)
decode_l_va
(
enum
encoding
dec
,
const
char
*
const
p
,
va_list
ap
)
{
{
...
@@ -154,15 +163,6 @@ err_decode(VRT_CTX, const char *enc)
...
@@ -154,15 +163,6 @@ err_decode(VRT_CTX, const char *enc)
}
}
}
}
static
inline
enum
case_e
parse_case
(
VCL_ENUM
case_s
)
{
if
(
case_s
==
vmod_enum_DEFAULT
)
return
(
DEFAULT
);
if
(
case_s
==
vmod_enum_LOWER
)
return
(
LOWER
);
if
(
case_s
==
vmod_enum_UPPER
)
return
(
UPPER
);
WRONG
(
"illegal case enum"
);
}
static
inline
int
static
inline
int
encodes_hex
(
enum
encoding
enc
)
encodes_hex
(
enum
encoding
enc
)
{
{
...
...
lib/libvmod_blob/vmod_blob.h
View file @
22480f2e
...
@@ -31,25 +31,21 @@
...
@@ -31,25 +31,21 @@
#include <sys/types.h>
#include <sys/types.h>
enum
encoding
{
enum
encoding
{
IDENTITY
=
1
,
_INVALID
=
0
,
BASE64
,
#define VMODENUM(x) x,
BASE64URL
,
#include "tbl_encodings.h"
BASE64URLNOPAD
,
HEX
,
URL
,
__MAX_ENCODING
__MAX_ENCODING
};
};
#define AENC(enc) assert((enc) >
= IDENTITY
&& (enc) < __MAX_ENCODING)
#define AENC(enc) assert((enc) >
_INVALID
&& (enc) < __MAX_ENCODING)
/*
/*
* The enums MUST appear in this order, since LOWER and UPPER are used to
* The enums MUST appear in this order, since LOWER and UPPER are used to
* index the array of cached encodings for the blob object.
* index the array of cached encodings for the blob object.
*/
*/
enum
case_e
{
enum
case_e
{
LOWER
,
#define VMODENUM(x) x,
UPPER
,
#include "tbl_case.h"
DEFAULT
,
};
};
/*
/*
...
...
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