Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-blobcode
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
libvmod-blobcode
Commits
1cc6c652
Commit
1cc6c652
authored
Jan 30, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a function for the version string and a "basic" VTC
parent
d17f5740
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
0 deletions
+64
-0
00basic.vtc
src/tests/00basic.vtc
+48
-0
vmod_blobcode.c
src/vmod_blobcode.c
+8
-0
vmod_blobcode.vcc
src/vmod_blobcode.vcc
+8
-0
No files found.
src/tests/00basic.vtc
0 → 100644
View file @
1cc6c652
# looks like -*- perl -*-
varnishtest
"vcl.use and .discard, and version string"
server
s1
{
}
-
start
varnish
v1
-
vcl
+
backend
{
import
blobcode
from
"${vmod_topbuild}/src/.libs/libvmod_blobcode.so"
;
}
-
start
varnish
v1
-
vcl
+
backend
{
}
varnish
v1
-
cli
"vcl.list"
varnish
v1
-
cli
"vcl.use vcl1"
varnish
v1
-
cli
"vcl.use vcl2"
varnish
v1
-
cli
"vcl.use vcl1"
varnish
v1
-
cli
"vcl.show vcl1"
varnish
v1
-
cli
"vcl.use vcl2"
varnish
v1
-
cli
"vcl.discard vcl1"
varnish
v1
-
cli
"vcl.list"
varnish
v1
-
vcl
{
import
blobcode
from
"${vmod_topbuild}/src/.libs/libvmod_blobcode.so"
;
backend
b
{
.
host
=
"${bad_ip}"
;
}
sub
vcl_recv
{
return
(
synth
(
200
));
}
sub
vcl_synth
{
set
resp
.
http
.
x
-
version
=
blobcode
.
version
();
if
(
!
resp
.
http
.
x
-
version
)
{
set
resp
.
status
=
500
;
}
return
(
deliver
);
}
}
client
c1
{
txreq
-
url
"/"
rxresp
expect
resp
.
status
==
200
expect
resp
.
http
.
x
-
version
~
"^.+$"
}
-
run
src/vmod_blobcode.c
View file @
1cc6c652
...
...
@@ -29,6 +29,8 @@
#include <errno.h>
#include <pthread.h>
#include "config.h"
#include "vcl.h"
#include "vrt.h"
...
...
@@ -487,3 +489,9 @@ vmod_transcode(VRT_CTX, VCL_ENUM decs, VCL_ENUM encs, const char *p, ...) {
wb_advance
(
&
wb
,
len
);
return
wb_finish
(
&
wb
,
NULL
);
}
VCL_STRING
__match_proto__
(
td_blobcode_version
)
vmod_version
(
VRT_CTX
__attribute__
((
unused
)))
{
return
VERSION
;
}
src/vmod_blobcode.vcc
View file @
1cc6c652
...
...
@@ -173,6 +173,14 @@ Example
``set req.http.Hex2Base64 = blobcode.transcode(decoding=HEX,``
``encoding=BASE64, encoded="666f6f");``
$Function STRING version()
Description
Returns the version string for this VMOD.
Example
``std.log("Using VMOD blobcode version " + blobcode.version());``
$Object blob(ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD, HEX} decoding,
STRING_LIST encoded)
...
...
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