Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
181fed08
Commit
181fed08
authored
Sep 26, 2014
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent a segfault on varnish reconnect in the varnishstat hitrate
implementation
parent
429966cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
varnishstat_curses.c
bin/varnishstat/varnishstat_curses.c
+10
-11
No files found.
bin/varnishstat/varnishstat_curses.c
View file @
181fed08
...
...
@@ -414,7 +414,7 @@ sample_hitrate(void)
double
hr
,
mr
,
ratio
;
uint64_t
hit
,
miss
;
if
(
VSC_C_m
gt
==
NULL
)
if
(
VSC_C_m
ain
==
NULL
)
return
;
tv
=
VTIM_mono
();
...
...
@@ -548,17 +548,8 @@ draw_status(void)
werase
(
w_status
);
if
(
VSC_C_mgt
!=
NULL
)
{
if
(
VSC_C_mgt
!=
NULL
)
up_mgt
=
VSC_C_mgt
->
uptime
;
if
(
COLS
>
70
)
{
mvwprintw
(
w_status
,
0
,
(
getmaxx
(
w_status
)
-
37
),
"Hitrate n: %8u %8u %8u"
,
hitrate
.
hr_10
.
n
,
hitrate
.
hr_100
.
n
,
hitrate
.
hr_1000
.
n
);
mvwprintw
(
w_status
,
1
,
(
getmaxx
(
w_status
)
-
37
),
" avg(n): %8.4f %8.4f %8.4f"
,
hitrate
.
hr_10
.
acc
,
hitrate
.
hr_100
.
acc
,
hitrate
.
hr_1000
.
acc
);
}
}
if
(
VSC_C_main
!=
NULL
)
up_chld
=
VSC_C_main
->
uptime
;
...
...
@@ -571,6 +562,14 @@ draw_status(void)
if
(
VSC_C_mgt
==
NULL
)
mvwprintw
(
w_status
,
0
,
COLS
-
strlen
(
discon
),
discon
);
else
if
(
COLS
>
70
)
{
mvwprintw
(
w_status
,
0
,
getmaxx
(
w_status
)
-
37
,
"Hitrate n: %8u %8u %8u"
,
hitrate
.
hr_10
.
n
,
hitrate
.
hr_100
.
n
,
hitrate
.
hr_1000
.
n
);
mvwprintw
(
w_status
,
1
,
getmaxx
(
w_status
)
-
37
,
" avg(n): %8.4f %8.4f %8.4f"
,
hitrate
.
hr_10
.
acc
,
hitrate
.
hr_100
.
acc
,
hitrate
.
hr_1000
.
acc
);
}
wnoutrefresh
(
w_status
);
}
...
...
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