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
744a7f30
Commit
744a7f30
authored
Jan 12, 2015
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
when joining the UA string from additional headers, seperate with a space
dont truncate the last character
parent
4dcf6aa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
dcs_varnish.c
src/dcs_varnish.c
+14
-2
No files found.
src/dcs_varnish.c
View file @
744a7f30
...
@@ -158,20 +158,32 @@ dcs_varnish_classify(dcs_ctx *ctx) {
...
@@ -158,20 +158,32 @@ dcs_varnish_classify(dcs_ctx *ctx) {
}
while
(
0
);
}
while
(
0
);
ua
=
uabuf
;
ua
=
uabuf
;
if
(
space
==
0
)
goto
nospc
;
for
(
i
=
0
;
i
<
DCS_VARNISH2_NHDRS
;
i
++
)
{
for
(
i
=
0
;
i
<
DCS_VARNISH2_NHDRS
;
i
++
)
{
r
=
DCS_GetHdr
(
ctx
,
&
hdrs
[
i
]);
r
=
DCS_GetHdr
(
ctx
,
&
hdrs
[
i
]);
if
(
r
&&
*
r
)
{
if
(
r
&&
*
r
)
{
if
(
ua_prepend
[
i
])
if
(
ua_prepend
[
i
])
{
appnd
(
w
,
space
,
ua_prepend
[
i
],
l
);
appnd
(
w
,
space
,
ua_prepend
[
i
],
l
);
}
else
{
// space==0 will heave left the loop
assert
(
space
>
0
);
*
w
++
=
' '
;
w
[
1
]
=
'\0'
;
if
(
--
space
==
0
)
break
;
}
appnd
(
w
,
space
,
r
,
l
);
appnd
(
w
,
space
,
r
,
l
);
}
}
}
}
nospc:
/* ensure the string is always terminated */
/* ensure the string is always terminated */
if
(
w
==
(
uabuf
+
UA_LIMIT
))
if
(
w
==
(
uabuf
+
UA_LIMIT
))
uabuf
[
UA_LIMIT
]
=
'\0'
;
uabuf
[
UA_LIMIT
]
=
'\0'
;
else
else
w
[
-
1
]
=
'\0'
;
*
w
=
'\0'
;
assert
(
ua
==
uabuf
);
assert
(
ua
==
uabuf
);
assert
(
w
>
uabuf
);
assert
(
w
>
uabuf
);
...
...
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