Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dcs_classifier
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
dcs_classifier
Commits
482478d4
Commit
482478d4
authored
Jan 12, 2015
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whitespace
parent
3d71fab9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
dcs_varnish.c
src/dcs_varnish.c
+3
-3
dcs01.vtc
src/tests/dcs01.vtc
+4
-5
dcs01.vtc
src/tests4/dcs01.vtc
+1
-2
No files found.
src/dcs_varnish.c
View file @
482478d4
...
...
@@ -60,8 +60,8 @@ const char *DCS_GetHdr(dcs_ctx *ctx, const struct gethdr_s *hdr) {
#else
/* VARNISH_MAJOR == 3 */
struct
gethdr_s
{
enum
gethdr_e
where
;
const
char
*
what
;
enum
gethdr_e
where
;
const
char
*
what
;
};
typedef
struct
sess
dcs_ctx
;
...
...
@@ -155,7 +155,7 @@ dcs_varnish_classify(dcs_ctx *ctx) {
appnd
(
w
,
space
,
ua
,
l
);
}
while
(
0
);
ua
=
uabuf
;
for
(
i
=
0
;
i
<
DCS_VARNISH2_NHDRS
;
i
++
)
{
r
=
DCS_GetHdr
(
ctx
,
&
hdrs
[
i
]);
if
(
r
&&
*
r
)
{
...
...
src/tests/dcs01.vtc
View file @
482478d4
...
...
@@ -7,16 +7,16 @@ server s1 {
txresp
} -start
varnish v1 -vcl+backend {
varnish v1 -vcl+backend {
import dcs from "${vmod_topbuild}/src/.libs/libvmod_dcs.so";
sub vcl_recv {
# this code will classify
# this code will classify
#
# for best performance in production, only call classify
# once or use inline-C to save the return value of
# classify (int)
# exotic use cases
set req.http.xx-entry-key = dcs.entry_key(dcs.classify());
set req.http.xx-type-id = dcs.type_id(dcs.classify());
...
...
@@ -65,7 +65,7 @@ client c1 {
client c1 {
txreq -hdr "User-Agent: Opera/9.80 (Android; Opera Mini/19.0.1340/34.1309; U; de) Presto/2.8.119 Version/11.10" \
-hdr "X-OperaMini-Phone-UA: Mozilla/5.0 (Linux; U; Android 4.3; de-de; ME302C Build/JSS15Q) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30"
-hdr "X-OperaMini-Phone-UA: Mozilla/5.0 (Linux; U; Android 4.3; de-de; ME302C Build/JSS15Q) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30"
rxresp
expect resp.status == 200
expect resp.http.xx-entry-key == "android*me302c"
...
...
@@ -74,4 +74,3 @@ client c1 {
expect resp.http.x-nb-classified == "Tablet"
expect resp.http.X-DeviceClass == "tablet"
} -run
src/tests4/dcs01.vtc
View file @
482478d4
...
...
@@ -65,7 +65,7 @@ client c1 {
client c1 {
txreq -hdr "User-Agent: Opera/9.80 (Android; Opera Mini/19.0.1340/34.1309; U; de) Presto/2.8.119 Version/11.10" \
-hdr "X-OperaMini-Phone-UA: Mozilla/5.0 (Linux; U; Android 4.3; de-de; ME302C Build/JSS15Q) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30"
-hdr "X-OperaMini-Phone-UA: Mozilla/5.0 (Linux; U; Android 4.3; de-de; ME302C Build/JSS15Q) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30"
rxresp
expect resp.status == 200
expect resp.http.xx-entry-key == "android*me302c"
...
...
@@ -74,4 +74,3 @@ client c1 {
expect resp.http.x-nb-classified == "Tablet"
expect resp.http.X-DeviceClass == "tablet"
} -run
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