Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
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
varnishevent3
Commits
d7b6dcf3
Commit
d7b6dcf3
authored
Oct 12, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
varnishevent: fix reading from a varnishlog binary dump
parent
67d9dfbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
varnishevent.c
bin/varnishevent/varnishevent.c
+19
-20
No files found.
bin/varnishevent/varnishevent.c
View file @
d7b6dcf3
...
...
@@ -535,13 +535,15 @@ main(int argc, char *argv[])
int
c
,
errnum
,
finite
=
0
,
a_flag
=
0
,
g_flag
=
0
,
D_flag
=
0
,
format_flag
=
0
;
const
char
*
P_arg
=
NULL
,
*
w_arg
=
NULL
;
char
scratch
[
BUFSIZ
]
,
cformat
[
BUFSIZ
]
;
char
scratch
[
BUFSIZ
];
struct
vpf_fh
*
pfh
=
NULL
;
vd
=
VSM_New
();
VSL_Setup
(
vd
);
cformat
[
0
]
=
'\0'
;
CONF_Init
();
read_default_config
();
while
((
c
=
getopt
(
argc
,
argv
,
VSL_ARGS
"aDP:Vw:fF:gG:"
))
!=
-
1
)
{
switch
(
c
)
{
case
'a'
:
...
...
@@ -552,7 +554,7 @@ main(int argc, char *argv[])
fprintf
(
stderr
,
"-f and -F can not be combined
\n
"
);
exit
(
1
);
}
strcpy
(
cformat
,
ALT_CFORMAT
);
strcpy
(
c
onfig
.
c
format
,
ALT_CFORMAT
);
format_flag
=
1
;
break
;
case
'F'
:
...
...
@@ -561,7 +563,7 @@ main(int argc, char *argv[])
exit
(
1
);
}
format_flag
=
1
;
strcpy
(
cformat
,
optarg
);
strcpy
(
c
onfig
.
c
format
,
optarg
);
break
;
case
'D'
:
D_flag
=
1
;
...
...
@@ -581,11 +583,6 @@ main(int argc, char *argv[])
case
'G'
:
strcpy
(
cli_config_filename
,
optarg
);
break
;
case
'r'
:
if
(
VSL_Arg
(
vd
,
c
,
optarg
)
>
0
)
usage
();
finite
=
1
;
break
;
case
'b'
:
case
'i'
:
case
'I'
:
...
...
@@ -596,15 +593,16 @@ main(int argc, char *argv[])
case
'm'
:
m_flag
=
1
;
/* Fall through */
default:
if
(
c
==
'r'
)
{
finite
=
1
;
strcpy
(
config
.
varnish_bindump
,
optarg
);
}
if
(
VSL_Arg
(
vd
,
c
,
optarg
)
>
0
)
break
;
usage
();
}
}
CONF_Init
();
read_default_config
();
if
(
!
EMPTY
(
cli_config_filename
))
{
printf
(
"Reading config from %s
\n
"
,
cli_config_filename
);
if
(
CONF_ReadFile
(
cli_config_filename
)
!=
0
)
{
...
...
@@ -614,9 +612,6 @@ main(int argc, char *argv[])
}
}
if
(
!
EMPTY
(
cformat
))
strcpy
(
config
.
cformat
,
cformat
);
if
(
VSL_Open
(
vd
,
1
))
exit
(
1
);
...
...
@@ -681,11 +676,15 @@ main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
}
strcpy
(
scratch
,
VSM_Name
(
vd
));
if
(
EMPTY
(
scratch
))
LOG_Log0
(
LOG_INFO
,
"Reading default varnish instance"
);
else
LOG_Log
(
LOG_INFO
,
"Reading varnish instance %s"
,
scratch
);
if
(
!
EMPTY
(
config
.
varnish_bindump
))
LOG_Log
(
LOG_INFO
,
"Reading from file: %s"
,
config
.
varnish_bindump
);
else
{
strcpy
(
scratch
,
VSM_Name
(
vd
));
if
(
EMPTY
(
scratch
))
LOG_Log0
(
LOG_INFO
,
"Reading default varnish instance"
);
else
LOG_Log
(
LOG_INFO
,
"Reading varnish instance %s"
,
scratch
);
}
strcpy
(
scratch
,
FMT_Get_i_Arg
());
if
(
EMPTY
(
scratch
))
{
...
...
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