Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
4aa876ee
Commit
4aa876ee
authored
Oct 31, 2011
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
works
parent
2b1905e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
50 deletions
+22
-50
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+22
-50
No files found.
bin/varnishncsa/varnishncsa.c
View file @
4aa876ee
...
...
@@ -57,6 +57,8 @@
* TODO: - Maybe rotate/compress log
*/
#define MAX_VCLLOG_KEYLENGTH 100
#include "config.h"
#include <ctype.h>
...
...
@@ -726,9 +728,6 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
const
char
*
h
,
*
tmp
;
char
fname
[
100
],
type
;
// maybe
const
char
*
key2
;
tmp
=
p
;
type
=
0
;
while
(
*
tmp
!=
'\0'
&&
*
tmp
!=
'}'
)
...
...
@@ -739,7 +738,6 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
memcpy
(
fname
,
p
+
1
,
tmp
-
p
-
2
);
fname
[
tmp
-
p
-
2
]
=
0
;
}
// printf("fname is: %s", fname);
switch
(
type
)
{
case
'i'
:
...
...
@@ -765,53 +763,27 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
VSB_cat
(
os
,
(
lp
->
df_handling
?
lp
->
df_handling
:
"-"
));
p
=
tmp
;
break
;
// } else if (strcmp(fname, "Varnish:vcllog") == 0) {
// VSB_cat(os, (lp->log1 ? lp->log1 : "-"));
// p = tmp;
// break;
}
case
'l'
:
// std.log("Foo: bar")
// %{Foo}l
printf
(
"case l was hit with fname: %s
\n
"
,
fname
);
// Extract "Foo" from fname
char
*
delim
;
char
keyword
[
100
];
char
*
kwptr
;
char
*
startpos
;
// keyword = "init";
delim
=
strchr
(
fname
,
':'
);
printf
(
": found at %d
\n
"
,
delim
-
fname
);
// startpos = delim - fname;
// buffer overflow all the way.
startpos
=
strncpy
(
keyword
,
delim
+
1
,
sizeof
keyword
);
printf
(
"meh"
);
printf
(
"startpos is: %d
\n
"
,
startpos
);
printf
(
"rest is: %s
\n
"
,
delim
+
1
);
// startpos);
printf
(
"keyword is: %s
\n
"
,
keyword
);
//keyword = delim + 1;
// printf("split2: %d\n", *split2);
// key2 = trimline(fname, split2);
//&&printf("key: %s\n", key2);
//keyword = strcpy("bar"; // trimline(fname+1, split);
//keyword = "foo";
//strcpy(key2, "bar"); // trimline(fname+1, split);
h
=
vcl_log
(
lp
,
keyword
);
VSB_cat
(
os
,
h
?
h
:
"-"
);
p
=
tmp
;
break
;
///////
case
'L'
:
{
char
*
delim
;
char
keyword
[
MAX_VCLLOG_KEYLENGTH
];
char
*
startpos
;
// Extract "key" from fname
delim
=
strchr
(
fname
,
':'
);
if
(
delim
==
NULL
)
{
break
;
}
startpos
=
strncpy
(
keyword
,
delim
+
1
,
MAX_VCLLOG_KEYLENGTH
);
h
=
vcl_log
(
lp
,
keyword
);
VSB_cat
(
os
,
h
?
h
:
"-"
);
p
=
tmp
;
break
;
}
default:
fprintf
(
stderr
,
"Unknown format starting at: %s
\n
"
,
--
p
);
fprintf
(
stderr
,
"Unknown
extended
format starting at: %s
\n
"
,
--
p
);
exit
(
1
);
}
break
;
...
...
@@ -821,8 +793,8 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
default:
fprintf
(
stderr
,
"Unknown format starting at: %s
\n
"
,
--
p
);
exit
(
1
);
}
}
}
// switch
}
// for
VSB_putc
(
os
,
'\n'
);
/* flush the stream */
...
...
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