Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
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
1
Merge Requests
1
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
varnishevent
Commits
8e2eb99c
Commit
8e2eb99c
authored
Sep 07, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for compatibility with Varnish 5.2.
The VSM API has changed.
parent
cb052cc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
varnishevent.c
src/varnishevent.c
+12
-10
No files found.
src/varnishevent.c
View file @
8e2eb99c
...
...
@@ -601,12 +601,13 @@ main(int argc, char *argv[])
{
int
c
,
errnum
,
status
,
a_flag
=
0
,
v_flag
=
0
,
d_flag
=
0
,
D_flag
=
0
;
char
*
P_arg
=
NULL
,
*
w_arg
=
NULL
,
*
q_arg
=
NULL
,
*
g_arg
=
NULL
,
*
n_arg
=
NULL
,
*
N_arg
=
NULL
,
*
l_arg
=
NULL
,
scratch
[
BUFSIZ
];
*
n_arg
=
NULL
,
*
N_arg
=
NULL
,
*
l_arg
=
NULL
,
scratch
[
BUFSIZ
],
*
vsm_name
=
NULL
;
char
cli_config_filename
[
PATH_MAX
+
1
]
=
""
;
struct
vpf_fh
*
pfh
=
NULL
;
struct
VSL_data
*
vsl
;
struct
VSLQ
*
vslq
;
struct
VSM_data
*
vsm
=
NULL
;
struct
vsm
*
vsm
=
NULL
;
struct
VSL_cursor
*
cursor
;
enum
VSL_grouping_e
grouping
=
VSL_g_vxid
;
unsigned
long
last_seen
=
0
;
...
...
@@ -788,15 +789,17 @@ main(int argc, char *argv[])
unsigned
options
=
VSL_COPT_BATCH
;
vsm
=
VSM_New
();
AN
(
vsm
);
if
(
n_arg
&&
VSM_
n_Arg
(
vsm
,
n_arg
)
<=
0
)
{
if
(
n_arg
&&
VSM_
Arg
(
vsm
,
'n'
,
n_arg
)
<=
0
)
{
LOG_Log
(
LOG_CRIT
,
"-n %s: %s
\n
"
,
n_arg
,
VSM_Error
(
vsm
));
exit
(
EXIT_FAILURE
);
}
if
(
VSM_
Open
(
vsm
)
<
0
)
{
LOG_Log
(
LOG_CRIT
,
"Cannot attach to shared memory
for instance %s: "
"%s"
,
VSM_Name
(
vsm
),
VSM_Error
(
vsm
));
if
(
VSM_
Attach
(
vsm
,
-
1
)
<
0
)
{
LOG_Log
(
LOG_CRIT
,
"Cannot attach to shared memory
: %s"
,
VSM_Error
(
vsm
));
exit
(
EXIT_FAILURE
);
}
vsm_name
=
VSM_Dup
(
vsm
,
"-i"
,
"Arg"
);
AN
(
vsm_name
);
if
(
!
d_flag
)
options
|=
VSL_COPT_TAIL
;
cursor
=
VSL_CursorVSM
(
vsl
,
vsm
,
options
);
...
...
@@ -858,10 +861,10 @@ main(int argc, char *argv[])
if
(
!
EMPTY
(
config
.
varnish_bindump
))
LOG_Log
(
LOG_INFO
,
"Reading from file: %s"
,
config
.
varnish_bindump
);
else
{
if
(
EMPTY
(
VSM_Name
(
vsm
)
))
if
(
EMPTY
(
vsm_name
))
LOG_Log0
(
LOG_INFO
,
"Reading default varnish instance"
);
else
LOG_Log
(
LOG_INFO
,
"Reading varnish instance %s"
,
VSM_Name
(
vsm
)
);
LOG_Log
(
LOG_INFO
,
"Reading varnish instance %s"
,
vsm_name
);
}
if
(
!
VSB_EMPTY
(
config
.
cformat
)
&&
VSB_EMPTY
(
config
.
bformat
))
...
...
@@ -1035,7 +1038,7 @@ main(int argc, char *argv[])
while
(
!
term
&&
vslq
==
NULL
)
{
AN
(
vsm
);
VTIM_sleep
(
0
.
1
);
if
(
VSM_
Open
(
vsm
)
)
{
if
(
VSM_
Attach
(
vsm
,
-
1
)
<
0
)
{
VSM_ResetError
(
vsm
);
continue
;
}
...
...
@@ -1043,7 +1046,6 @@ main(int argc, char *argv[])
VSL_COPT_TAIL
|
VSL_COPT_BATCH
);
if
(
cursor
==
NULL
)
{
VSL_ResetError
(
vsl
);
VSM_Close
(
vsm
);
continue
;
}
vslq
=
VSLQ_New
(
vsl
,
&
cursor
,
grouping
,
q_arg
);
...
...
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