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
66572d21
Commit
66572d21
authored
Jan 21, 2019
by
Poul-Henning Kamp
Committed by
Dridi Boukelmoune
Jul 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Monday morning flexelinting
parent
4c10ca24
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
52 deletions
+40
-52
varnishadm.c
bin/varnishadm/varnishadm.c
+31
-46
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+3
-1
base64.c
lib/libvmod_blob/base64.c
+4
-3
vmod_debug_obj.c
lib/libvmod_debug/vmod_debug_obj.c
+2
-0
shard_dir.h
lib/libvmod_directors/shard_dir.h
+0
-2
No files found.
bin/varnishadm/varnishadm.c
View file @
66572d21
...
...
@@ -73,7 +73,7 @@
} while (0)
static
double
timeout
=
5
;
static
double
timeout
=
5
;
// XXX should be settable by arg ?
static
void
cli_write
(
int
sock
,
const
char
*
s
)
...
...
@@ -192,7 +192,7 @@ send_line(char *l)
cli_write
(
_line_sock
,
l
);
cli_write
(
_line_sock
,
"
\n
"
);
if
(
*
l
)
add_history
(
l
);
AZ
(
add_history
(
l
)
);
rl_callback_handler_install
(
"varnish> "
,
send_line
);
}
else
{
RL_EXIT
(
0
);
...
...
@@ -234,6 +234,29 @@ varnishadm_completion (const char *text, int start, int end)
return
(
matches
);
}
static
void
pass_answer
(
int
fd
)
{
unsigned
u
,
status
;
char
*
answer
=
NULL
;
u
=
VCLI_ReadResult
(
fd
,
&
status
,
&
answer
,
timeout
);
if
(
u
)
{
if
(
status
==
CLIS_COMMS
)
RL_EXIT
(
0
);
if
(
answer
)
fprintf
(
stderr
,
"%s
\n
"
,
answer
);
RL_EXIT
(
1
);
}
printf
(
"%u
\n
"
,
status
);
if
(
answer
)
{
printf
(
"%s
\n
"
,
answer
);
free
(
answer
);
}
(
void
)
fflush
(
stdout
);
}
/*
* No arguments given, simply pass bytes on stdin/stdout and CLI socket
* Send a "banner" to varnish, to provoke a welcome message.
...
...
@@ -242,7 +265,6 @@ static void
interactive
(
int
sock
)
{
struct
pollfd
fds
[
2
];
char
buf
[
1024
];
int
i
;
char
*
answer
=
NULL
;
unsigned
u
,
status
;
...
...
@@ -293,25 +315,8 @@ interactive(int sock)
assert
(
i
>
0
);
if
(
fds
[
0
].
revents
&
POLLIN
)
{
/* Get rid of the prompt, kinda hackish */
u
=
write
(
1
,
"
\r
\r
"
,
13
);
u
=
VCLI_ReadResult
(
fds
[
0
].
fd
,
&
status
,
&
answer
,
timeout
);
if
(
u
)
{
if
(
status
==
CLIS_COMMS
)
RL_EXIT
(
0
);
if
(
answer
)
fprintf
(
stderr
,
"%s
\n
"
,
answer
);
RL_EXIT
(
1
);
}
bprintf
(
buf
,
"%u
\n
"
,
status
);
u
=
write
(
1
,
buf
,
strlen
(
buf
));
if
(
answer
)
{
u
=
write
(
1
,
answer
,
strlen
(
answer
));
u
=
write
(
1
,
"
\n
"
,
1
);
free
(
answer
);
answer
=
NULL
;
}
printf
(
"
\r
\r
"
);
pass_answer
(
fds
[
0
].
fd
);
rl_forced_update_display
();
}
if
(
fds
[
1
].
revents
&
POLLIN
)
{
...
...
@@ -329,8 +334,6 @@ pass(int sock)
struct
pollfd
fds
[
2
];
char
buf
[
1024
];
int
i
;
char
*
answer
=
NULL
;
unsigned
u
,
status
;
ssize_t
n
;
fds
[
0
].
fd
=
sock
;
...
...
@@ -343,26 +346,8 @@ pass(int sock)
continue
;
}
assert
(
i
>
0
);
if
(
fds
[
0
].
revents
&
POLLIN
)
{
u
=
VCLI_ReadResult
(
fds
[
0
].
fd
,
&
status
,
&
answer
,
timeout
);
if
(
u
)
{
if
(
status
==
CLIS_COMMS
)
RL_EXIT
(
0
);
if
(
answer
)
fprintf
(
stderr
,
"%s
\n
"
,
answer
);
RL_EXIT
(
1
);
}
bprintf
(
buf
,
"%u
\n
"
,
status
);
u
=
write
(
1
,
buf
,
strlen
(
buf
));
if
(
answer
)
{
u
=
write
(
1
,
answer
,
strlen
(
answer
));
u
=
write
(
1
,
"
\n
"
,
1
);
free
(
answer
);
answer
=
NULL
;
}
}
if
(
fds
[
0
].
revents
&
POLLIN
)
pass_answer
(
fds
[
0
].
fd
);
if
(
fds
[
1
].
revents
&
POLLIN
||
fds
[
1
].
revents
&
POLLHUP
)
{
n
=
read
(
fds
[
1
].
fd
,
buf
,
sizeof
buf
-
1
);
if
(
n
==
0
)
{
...
...
@@ -392,8 +377,8 @@ usage(int status)
static
int
n_arg_sock
(
const
char
*
n_arg
,
const
char
*
t_arg
)
{
char
*
T_arg
=
NULL
,
*
T_start
=
NULL
;
char
*
S_arg
=
NULL
;
char
*
T_arg
,
*
T_start
;
char
*
S_arg
;
struct
vsm
*
vsm
;
char
*
p
;
int
sock
;
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
66572d21
...
...
@@ -784,7 +784,9 @@ ved_stripgzip(struct req *req, const struct boc *boc)
ecx
->
l_crc
+=
ilen
;
}
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
* Straight through without processing.
*/
static
int
v_matchproto_
(
vdp_fini_f
)
ved_vdp_fini
(
struct
req
*
req
,
void
**
priv
)
...
...
lib/libvmod_blob/base64.c
View file @
66572d21
...
...
@@ -140,6 +140,7 @@ base64_decode(const enum encoding dec, char *restrict const buf,
unsigned
u
=
0
,
term
=
0
;
int
n
=
0
;
size_t
len
=
SIZE_MAX
;
const
char
*
s
;
AN
(
buf
);
AN
(
alpha
);
...
...
@@ -149,7 +150,7 @@ base64_decode(const enum encoding dec, char *restrict const buf,
len
=
inlen
;
for
(
int
i
=
0
;
len
>
0
&&
i
<
strings
->
n
;
i
++
)
{
const
char
*
s
=
strings
->
p
[
i
];
s
=
strings
->
p
[
i
];
if
(
s
==
NULL
)
continue
;
...
...
@@ -159,7 +160,7 @@ base64_decode(const enum encoding dec, char *restrict const buf,
}
while
(
*
s
&&
len
)
{
while
(
n
<
4
)
{
char
b
=
alpha
->
i64
[(
u
nsigned
)
*
s
++
];
char
b
=
alpha
->
i64
[(
u
int8_t
)
*
s
++
];
u
<<=
6
;
if
(
b
==
ILL
)
{
errno
=
EINVAL
;
...
...
@@ -170,7 +171,7 @@ base64_decode(const enum encoding dec, char *restrict const buf,
term
++
;
continue
;
}
u
|=
(
u
nsigned
)
b
;
u
|=
(
u
int8_t
)
b
;
if
(
--
len
==
0
)
break
;
if
(
!*
s
)
...
...
lib/libvmod_debug/vmod_debug_obj.c
View file @
66572d21
...
...
@@ -181,6 +181,8 @@ xyzzy_obj_opt__init(VRT_CTX,
if
(
args
->
valid_s
)
AN
(
args
->
s
);
(
void
)
args
->
valid_b
;
(
void
)
args
->
b
;
AN
(
op
);
AZ
(
*
op
);
...
...
lib/libvmod_directors/shard_dir.h
View file @
66572d21
...
...
@@ -42,10 +42,8 @@ enum healthy_e {
};
enum
resolve_e
{
_RESOLVE_E_INVALID
=
0
,
#define VMODENUM(x) x,
#include "tbl_resolve.h"
_RESOLVE_E_MAX
};
struct
vbitmap
;
...
...
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