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
9857918c
Commit
9857918c
authored
Nov 14, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add VCLI_Overflow() so we can stop rendering bans when the CLI
output buffer is full.
parent
ccf9f85a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
cache_ban.c
bin/varnishd/cache/cache_ban.c
+2
-0
vcli_priv.h
include/vcli_priv.h
+1
-0
cli_common.c
lib/libvarnish/cli_common.c
+11
-0
No files found.
bin/varnishd/cache/cache_ban.c
View file @
9857918c
...
...
@@ -1071,6 +1071,8 @@ ccf_ban_list(struct cli *cli, const char * const *av, void *priv)
b
->
flags
&
BAN_F_GONE
?
"G"
:
" "
);
ban_render
(
cli
,
b
->
spec
);
VCLI_Out
(
cli
,
"
\n
"
);
if
(
VCLI_Overflow
(
cli
))
break
;
if
(
cache_param
->
diag_bitmap
&
0x80000
)
{
Lck_Lock
(
&
ban_mtx
);
struct
objcore
*
oc
;
...
...
include/vcli_priv.h
View file @
9857918c
...
...
@@ -52,6 +52,7 @@ struct cli_proto {
};
/* The implementation must provide these functions */
int
VCLI_Overflow
(
struct
cli
*
cli
);
void
VCLI_Out
(
struct
cli
*
cli
,
const
char
*
fmt
,
...);
void
VCLI_Quote
(
struct
cli
*
cli
,
const
char
*
str
);
void
VCLI_SetResult
(
struct
cli
*
cli
,
unsigned
r
);
lib/libvarnish/cli_common.c
View file @
9857918c
...
...
@@ -69,6 +69,17 @@ VCLI_Out(struct cli *cli, const char *fmt, ...)
va_end
(
ap
);
}
/*lint -e{818} cli could be const */
int
VCLI_Overflow
(
struct
cli
*
cli
)
{
CHECK_OBJ_NOTNULL
(
cli
,
CLI_MAGIC
);
if
(
cli
->
result
==
CLIS_TRUNCATED
||
VSB_len
(
cli
->
sb
)
>=
*
cli
->
limit
)
return
(
1
);
return
(
0
);
}
/*lint -e{818} cli could be const */
void
VCLI_Quote
(
struct
cli
*
cli
,
const
char
*
s
)
...
...
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