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
704c3d07
Commit
704c3d07
authored
Jan 07, 2021
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: rm vmod/hex.h
parent
185c4296
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
51 deletions
+12
-51
Makefile.am
vmod/Makefile.am
+0
-1
base64.c
vmod/base64.c
+0
-3
hex.c
vmod/hex.c
+2
-4
hex.h
vmod/hex.h
+0
-39
url.c
vmod/url.c
+2
-4
vmod_blob.h
vmod/vmod_blob.h
+8
-0
No files found.
vmod/Makefile.am
View file @
704c3d07
...
...
@@ -22,7 +22,6 @@ libvmod_blob_la_SOURCES = \
vmod_blob.h
\
id.c
\
base64.c
\
hex.h
\
hex.c
\
url.c
\
tbl_encodings.h
\
...
...
vmod/base64.c
View file @
704c3d07
...
...
@@ -36,9 +36,6 @@
#include "vmod_blob.h"
#define ILL ((int8_t) 127)
#define PAD ((int8_t) 126)
static
const
struct
b64_alphabet
{
const
char
b64
[
64
];
const
int8_t
i64
[
256
];
...
...
vmod/hex.c
View file @
704c3d07
...
...
@@ -38,8 +38,6 @@
#include "vmod_blob.h"
#include "hex.h"
const
char
hex_alphabet
[][
16
]
=
{
"0123456789abcdef"
,
"0123456789ABCDEF"
...
...
@@ -50,7 +48,7 @@ const char hex_alphabet[][16] = {
* hex digits with their binary values. This fits all of the hex digits
* into 55 bytes (cacheline friendly).
*/
const
uint8_t
nibble
[]
=
{
const
uint8_t
hex_
nibble
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
10
,
11
,
12
,
13
,
14
,
15
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
...
...
@@ -74,7 +72,7 @@ hex_decode_l(size_t l)
static
inline
char
hex2byte
(
const
unsigned
char
hi
,
const
unsigned
char
lo
)
{
return
((
nibble
[
hi
-
'0'
]
<<
4
)
|
nibble
[
lo
-
'0'
]);
return
((
hex_nibble
[
hi
-
'0'
]
<<
4
)
|
hex_
nibble
[
lo
-
'0'
]);
}
ssize_t
...
...
vmod/hex.h
deleted
100644 → 0
View file @
185c4296
/*-
* Copyright 2016 UPLEX - Nils Goroll Systemoptimierung
* All rights reserved.
*
* Authors: Nils Goroll <nils.goroll@uplex.de>
* Geoffrey Simmons <geoffrey.simmons@uplex.de>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <stdint.h>
#define ILL ((int8_t) 127)
/* These are defined in hex.c */
extern
const
char
hex_alphabet
[][
16
];
extern
const
uint8_t
nibble
[];
vmod/url.c
View file @
704c3d07
...
...
@@ -36,8 +36,6 @@
#include "vmod_blob.h"
#include "hex.h"
/* Decoder states */
enum
state_e
{
NORMAL
,
...
...
@@ -155,7 +153,7 @@ url_decode(const enum encoding dec, blob_dest_t buf,
break
;
case
PERCENT
:
if
(
isoutofrange
(
*
s
)
||
(
nib
=
nibble
[
*
s
-
'0'
])
==
ILL
)
{
(
nib
=
hex_
nibble
[
*
s
-
'0'
])
==
ILL
)
{
errno
=
EINVAL
;
return
(
-
1
);
}
...
...
@@ -167,7 +165,7 @@ url_decode(const enum encoding dec, blob_dest_t buf,
return
(
-
1
);
}
if
(
isoutofrange
(
*
s
)
||
(
nib2
=
nibble
[
*
s
-
'0'
])
==
ILL
)
{
(
nib2
=
hex_
nibble
[
*
s
-
'0'
])
==
ILL
)
{
errno
=
EINVAL
;
return
(
-
1
);
}
...
...
vmod/vmod_blob.h
View file @
704c3d07
...
...
@@ -91,6 +91,11 @@ ssize_t encode_f(const enum encoding enc, const enum case_e kase,
blob_dest_t
buf
,
blob_len_t
buflen
,
blob_src_t
in
,
blob_len_t
inlen
);
/* Special lookup characters */
#define ILL ((int8_t) 127)
#define PAD ((int8_t) 126)
/*
* General interface for a decoder: decode the concatenation of strings
* (obtained from STRANDS) into buf, and return the length of decoded
...
...
@@ -135,6 +140,9 @@ len_f hex_decode_l;
encode_f
hex_encode
;
decode_f
hex_decode
;
extern
const
char
hex_alphabet
[][
16
];
extern
const
uint8_t
hex_nibble
[];
/* url.c */
len_f
url_encode_l
;
len_f
url_decode_l
;
...
...
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