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
1520837f
Commit
1520837f
authored
Jan 15, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Systematic rename to make things consistent
parent
2b72a16e
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
42 deletions
+42
-42
cache_panic.c
bin/varnishd/cache/cache_panic.c
+1
-1
cache_session.c
bin/varnishd/cache/cache_session.c
+2
-2
mgt_param_tweak.c
bin/varnishd/mgt/mgt_param_tweak.c
+1
-1
cache_waiter.c
bin/varnishd/waiter/cache_waiter.c
+9
-9
cache_waiter_epoll.c
bin/varnishd/waiter/cache_waiter_epoll.c
+7
-7
cache_waiter_kqueue.c
bin/varnishd/waiter/cache_waiter_kqueue.c
+5
-5
cache_waiter_poll.c
bin/varnishd/waiter/cache_waiter_poll.c
+4
-4
cache_waiter_ports.c
bin/varnishd/waiter/cache_waiter_ports.c
+5
-5
mgt_waiter.c
bin/varnishd/waiter/mgt_waiter.c
+1
-1
waiter.h
bin/varnishd/waiter/waiter.h
+4
-4
waiter_priv.h
bin/varnishd/waiter/waiter_priv.h
+3
-3
No files found.
bin/varnishd/cache/cache_panic.c
View file @
1520837f
...
...
@@ -539,7 +539,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
VSB_printf
(
pan_vsp
,
"version = %s
\n
"
,
VCS_version
);
VSB_printf
(
pan_vsp
,
"ident = %s,%s
\n
"
,
VSB_data
(
vident
)
+
1
,
W
AIT
_GetName
());
VSB_data
(
vident
)
+
1
,
W
ait
_GetName
());
pan_backtrace
();
...
...
bin/varnishd/cache/cache_session.c
View file @
1520837f
...
...
@@ -296,7 +296,7 @@ SES_Wait(struct sess *sp)
sp
->
waited
.
fd
=
sp
->
fd
;
sp
->
waited
.
ptr
=
sp
;
sp
->
waited
.
deadline
=
sp
->
t_idle
;
if
(
W
AIT
_Enter
(
pp
->
http1_waiter
,
&
sp
->
waited
))
{
if
(
W
ait
_Enter
(
pp
->
http1_waiter
,
&
sp
->
waited
))
{
VSC_C_main
->
sess_pipe_overflow
++
;
SES_Delete
(
sp
,
SC_SESS_PIPE_OVERFLOW
,
NAN
);
}
...
...
@@ -467,7 +467,7 @@ SES_NewPool(struct pool *wp, unsigned pool_no)
bprintf
(
nb
,
"sess%u"
,
pool_no
);
pp
->
mpl_sess
=
MPL_New
(
nb
,
&
cache_param
->
sess_pool
,
&
cache_param
->
workspace_session
);
pp
->
http1_waiter
=
W
AIT_Init
(
ses_handle
,
&
cache_param
->
timeout_idle
);
pp
->
http1_waiter
=
W
ait_New
(
ses_handle
,
&
cache_param
->
timeout_idle
);
return
(
pp
);
}
...
...
bin/varnishd/mgt/mgt_param_tweak.c
View file @
1520837f
...
...
@@ -574,7 +574,7 @@ tweak_waiter(struct vsb *vsb, const struct parspec *par, const char *arg)
/* XXX should have tweak_generic_string */
(
void
)
par
;
return
(
W
AIT_tweak_waiter
(
vsb
,
arg
));
return
(
W
ait_Argument
(
vsb
,
arg
));
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/waiter/cache_waiter.c
View file @
1520837f
...
...
@@ -45,7 +45,7 @@
#define NEV 8192
const
char
*
W
AIT
_GetName
(
void
)
W
ait
_GetName
(
void
)
{
if
(
waiter
!=
NULL
)
...
...
@@ -55,7 +55,7 @@ WAIT_GetName(void)
}
struct
waiter
*
W
AIT_Init
(
waiter_handle_f
*
func
,
volatile
double
*
tmo
)
W
ait_New
(
waiter_handle_f
*
func
,
volatile
double
*
tmo
)
{
struct
waiter
*
w
;
...
...
@@ -70,7 +70,7 @@ WAIT_Init(waiter_handle_f *func, volatile double *tmo)
w
->
impl
=
waiter
;
w
->
func
=
func
;
w
->
tmo
=
tmo
;
VTAILQ_INIT
(
&
w
->
sess
head
);
VTAILQ_INIT
(
&
w
->
wait
head
);
waiter
->
init
(
w
);
AN
(
w
->
impl
->
pass
||
w
->
pfd
>
0
);
...
...
@@ -78,7 +78,7 @@ WAIT_Init(waiter_handle_f *func, volatile double *tmo)
}
void
W
AIT
_UsePipe
(
struct
waiter
*
w
)
W
ait
_UsePipe
(
struct
waiter
*
w
)
{
CHECK_OBJ_NOTNULL
(
w
,
WAITER_MAGIC
);
...
...
@@ -90,12 +90,12 @@ WAIT_UsePipe(struct waiter *w)
ALLOC_OBJ
(
w
->
pipe_w
,
WAITED_MAGIC
);
w
->
pipe_w
->
fd
=
w
->
pipes
[
0
];
w
->
pipe_w
->
deadline
=
9e99
;
VTAILQ_INSERT_HEAD
(
&
w
->
sess
head
,
w
->
pipe_w
,
list
);
VTAILQ_INSERT_HEAD
(
&
w
->
wait
head
,
w
->
pipe_w
,
list
);
waiter
->
inject
(
w
,
w
->
pipe_w
);
}
int
W
AIT
_Enter
(
const
struct
waiter
*
w
,
struct
waited
*
wp
)
W
ait
_Enter
(
const
struct
waiter
*
w
,
struct
waited
*
wp
)
{
ssize_t
written
;
...
...
@@ -116,7 +116,7 @@ WAIT_Enter(const struct waiter *w, struct waited *wp)
}
void
W
AIT_h
andle
(
struct
waiter
*
w
,
struct
waited
*
wp
,
enum
wait_event
ev
,
double
now
)
W
ait_H
andle
(
struct
waiter
*
w
,
struct
waited
*
wp
,
enum
wait_event
ev
,
double
now
)
{
struct
waited
*
ss
[
NEV
];
int
i
,
j
;
...
...
@@ -131,7 +131,7 @@ WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
for
(
j
=
0
;
i
>=
sizeof
ss
[
0
];
j
++
,
i
-=
sizeof
ss
[
0
])
{
CHECK_OBJ_NOTNULL
(
ss
[
j
],
WAITED_MAGIC
);
assert
(
ss
[
j
]
->
fd
>=
0
);
VTAILQ_INSERT_TAIL
(
&
w
->
sess
head
,
ss
[
j
],
list
);
VTAILQ_INSERT_TAIL
(
&
w
->
wait
head
,
ss
[
j
],
list
);
w
->
impl
->
inject
(
w
,
ss
[
j
]);
}
AZ
(
i
);
...
...
@@ -140,6 +140,6 @@ WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
if
(
w
->
impl
->
evict
!=
NULL
)
w
->
impl
->
evict
(
w
,
wp
);
VTAILQ_REMOVE
(
&
w
->
sess
head
,
wp
,
list
);
VTAILQ_REMOVE
(
&
w
->
wait
head
,
wp
,
list
);
w
->
func
(
wp
,
ev
,
now
);
}
bin/varnishd/waiter/cache_waiter_epoll.c
View file @
1520837f
...
...
@@ -92,13 +92,13 @@ vwe_eev(struct vwe *vwe, const struct epoll_event *ep, double now)
AN
(
ep
->
data
.
ptr
);
CAST_OBJ_NOTNULL
(
sp
,
ep
->
data
.
ptr
,
WAITED_MAGIC
);
if
(
ep
->
events
&
EPOLLIN
||
ep
->
events
&
EPOLLPRI
)
{
W
AIT_h
andle
(
vwe
->
waiter
,
sp
,
WAITER_ACTION
,
now
);
W
ait_H
andle
(
vwe
->
waiter
,
sp
,
WAITER_ACTION
,
now
);
}
else
if
(
ep
->
events
&
EPOLLERR
)
{
W
AIT_h
andle
(
vwe
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
W
ait_H
andle
(
vwe
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
}
else
if
(
ep
->
events
&
EPOLLHUP
)
{
W
AIT_h
andle
(
vwe
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
W
ait_H
andle
(
vwe
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
}
else
if
(
ep
->
events
&
EPOLLRDHUP
)
{
W
AIT_h
andle
(
vwe
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
W
ait_H
andle
(
vwe
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
}
}
...
...
@@ -136,9 +136,9 @@ vwe_thread(void *priv)
/* check for timeouts */
deadline
=
now
-
*
vwe
->
waiter
->
tmo
;
VTAILQ_FOREACH_SAFE
(
sp
,
&
vwe
->
waiter
->
sess
head
,
list
,
sp2
)
{
VTAILQ_FOREACH_SAFE
(
sp
,
&
vwe
->
waiter
->
wait
head
,
list
,
sp2
)
{
if
(
sp
->
deadline
<
deadline
)
W
AIT_h
andle
(
vwe
->
waiter
,
sp
,
W
ait_H
andle
(
vwe
->
waiter
,
sp
,
WAITER_TIMEOUT
,
now
);
}
}
...
...
@@ -180,7 +180,7 @@ vwe_init(struct waiter *w)
vwe
->
epfd
=
epoll_create
(
1
);
assert
(
vwe
->
epfd
>=
0
);
W
AIT
_UsePipe
(
w
);
W
ait
_UsePipe
(
w
);
AZ
(
pipe
(
vwe
->
timer_pipes
));
AZ
(
VFIL_nonblocking
(
vwe
->
timer_pipes
[
0
]));
...
...
bin/varnishd/waiter/cache_waiter_kqueue.c
View file @
1520837f
...
...
@@ -110,10 +110,10 @@ vwk_sess_ev(const struct vwk *vwk, const struct kevent *kp, double now)
CAST_OBJ_NOTNULL
(
sp
,
kp
->
udata
,
WAITED_MAGIC
);
if
(
kp
->
data
>
0
)
{
W
AIT_h
andle
(
vwk
->
waiter
,
sp
,
WAITER_ACTION
,
now
);
W
ait_H
andle
(
vwk
->
waiter
,
sp
,
WAITER_ACTION
,
now
);
return
;
}
else
if
(
kp
->
flags
&
EV_EOF
)
{
W
AIT_h
andle
(
vwk
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
W
ait_H
andle
(
vwk
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
return
;
}
else
{
WRONG
(
"unknown kqueue state"
);
...
...
@@ -171,12 +171,12 @@ vwk_thread(void *priv)
vwk_kq_flush
(
vwk
);
deadline
=
now
-
*
vwk
->
waiter
->
tmo
;
for
(;;)
{
sp
=
VTAILQ_FIRST
(
&
vwk
->
waiter
->
sess
head
);
sp
=
VTAILQ_FIRST
(
&
vwk
->
waiter
->
wait
head
);
if
(
sp
==
NULL
)
break
;
if
(
sp
->
deadline
>
deadline
)
break
;
W
AIT_h
andle
(
vwk
->
waiter
,
sp
,
WAITER_TIMEOUT
,
now
);
W
ait_H
andle
(
vwk
->
waiter
,
sp
,
WAITER_TIMEOUT
,
now
);
}
}
NEEDLESS_RETURN
(
NULL
);
...
...
@@ -197,7 +197,7 @@ vwk_init(struct waiter *w)
EV_SET
(
&
vwk
->
ki
[
vwk
->
nki
],
0
,
EVFILT_TIMER
,
EV_ADD
,
0
,
100
,
NULL
);
vwk
->
nki
++
;
W
AIT
_UsePipe
(
w
);
W
ait
_UsePipe
(
w
);
AZ
(
pthread_create
(
&
vwk
->
thread
,
NULL
,
vwk_thread
,
vwk
));
}
...
...
bin/varnishd/waiter/cache_waiter_poll.c
View file @
1520837f
...
...
@@ -146,7 +146,7 @@ vwp_main(void *priv)
v2
=
v
;
now
=
VTIM_real
();
deadline
=
now
-
*
vwp
->
waiter
->
tmo
;
VTAILQ_FOREACH_SAFE
(
sp
,
&
vwp
->
waiter
->
sess
head
,
list
,
sp2
)
{
VTAILQ_FOREACH_SAFE
(
sp
,
&
vwp
->
waiter
->
wait
head
,
list
,
sp2
)
{
if
(
v
!=
0
&&
v2
==
0
)
break
;
CHECK_OBJ_NOTNULL
(
sp
,
WAITED_MAGIC
);
...
...
@@ -158,10 +158,10 @@ vwp_main(void *priv)
if
(
vwp
->
pollfd
[
fd
].
revents
)
{
v2
--
;
vwp
->
pollfd
[
fd
].
revents
=
0
;
W
AIT_h
andle
(
vwp
->
waiter
,
sp
,
WAITER_ACTION
,
W
ait_H
andle
(
vwp
->
waiter
,
sp
,
WAITER_ACTION
,
now
);
}
else
if
(
sp
->
deadline
<=
deadline
)
{
W
AIT_h
andle
(
vwp
->
waiter
,
sp
,
WAITER_TIMEOUT
,
W
ait_H
andle
(
vwp
->
waiter
,
sp
,
WAITER_TIMEOUT
,
now
);
}
}
...
...
@@ -182,7 +182,7 @@ vwp_poll_init(struct waiter *w)
vwp
->
waiter
=
w
;
vwp_pollspace
(
vwp
,
256
);
W
AIT
_UsePipe
(
w
);
W
ait
_UsePipe
(
w
);
AZ
(
pthread_create
(
&
vwp
->
poll_thread
,
NULL
,
vwp_main
,
vwp
));
}
...
...
bin/varnishd/waiter/cache_waiter_ports.c
View file @
1520837f
...
...
@@ -79,7 +79,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
if
(
ev
->
portev_source
==
PORT_SOURCE_USER
)
{
CAST_OBJ_NOTNULL
(
sp
,
ev
->
portev_user
,
WAITED_MAGIC
);
assert
(
sp
->
fd
>=
0
);
VTAILQ_INSERT_TAIL
(
&
vws
->
waiter
->
sess
head
,
sp
,
list
);
VTAILQ_INSERT_TAIL
(
&
vws
->
waiter
->
wait
head
,
sp
,
list
);
vws_add
(
vws
,
sp
->
fd
,
sp
);
}
else
{
assert
(
ev
->
portev_source
==
PORT_SOURCE_FD
);
...
...
@@ -87,7 +87,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
assert
(
sp
->
fd
>=
0
);
if
(
ev
->
portev_events
&
POLLERR
)
{
vws_del
(
vws
,
sp
->
fd
);
W
AIT_h
andle
(
vws
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
W
ait_H
andle
(
vws
->
waiter
,
sp
,
WAITER_REMCLOSE
,
now
);
return
;
}
...
...
@@ -105,7 +105,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
* threadID=129476&tstart=0
*/
vws_del
(
vws
,
sp
->
fd
);
W
AIT_h
andle
(
vws
->
waiter
,
sp
,
WAITER_ACTION
,
now
);
W
ait_H
andle
(
vws
->
waiter
,
sp
,
WAITER_ACTION
,
now
);
}
return
;
}
...
...
@@ -199,14 +199,14 @@ vws_thread(void *priv)
*/
for
(;;)
{
sp
=
VTAILQ_FIRST
(
&
vws
->
waiter
->
sess
head
);
sp
=
VTAILQ_FIRST
(
&
vws
->
waiter
->
wait
head
);
if
(
sp
==
NULL
)
break
;
if
(
sp
->
deadline
>
deadline
)
{
break
;
}
vws_del
(
vws
,
sp
->
fd
);
W
AIT_h
andle
(
vws
->
waiter
,
sp
,
WAITER_TIMEOUT
,
now
);
W
ait_H
andle
(
vws
->
waiter
,
sp
,
WAITER_TIMEOUT
,
now
);
}
/*
...
...
bin/varnishd/waiter/mgt_waiter.c
View file @
1520837f
...
...
@@ -55,7 +55,7 @@ static const struct waiter_impl *const waiter_impls[] = {
struct
waiter_impl
const
*
waiter
;
int
W
AIT_tweak_waiter
(
struct
vsb
*
vsb
,
const
char
*
arg
)
W
ait_Argument
(
struct
vsb
*
vsb
,
const
char
*
arg
)
{
int
i
;
...
...
bin/varnishd/waiter/waiter.h
View file @
1520837f
...
...
@@ -56,9 +56,9 @@ enum wait_event {
typedef
void
waiter_handle_f
(
struct
waited
*
,
enum
wait_event
,
double
now
);
/* cache_waiter.c */
int
W
AIT
_Enter
(
const
struct
waiter
*
,
struct
waited
*
);
struct
waiter
*
W
AIT_Init
(
waiter_handle_f
*
,
volatile
double
*
timeout
);
const
char
*
W
AIT
_GetName
(
void
);
int
W
ait
_Enter
(
const
struct
waiter
*
,
struct
waited
*
);
struct
waiter
*
W
ait_New
(
waiter_handle_f
*
,
volatile
double
*
timeout
);
const
char
*
W
ait
_GetName
(
void
);
/* mgt_waiter.c */
int
W
AIT_tweak_waiter
(
struct
vsb
*
vsb
,
const
char
*
arg
);
int
W
ait_Argument
(
struct
vsb
*
vsb
,
const
char
*
arg
);
bin/varnishd/waiter/waiter_priv.h
View file @
1520837f
...
...
@@ -41,7 +41,7 @@ struct waiter {
struct
waited
*
pipe_w
;
volatile
double
*
tmo
;
VTAILQ_HEAD
(,
waited
)
sess
head
;
VTAILQ_HEAD
(,
waited
)
wait
head
;
void
*
priv
;
int
pfd
;
...
...
@@ -62,8 +62,8 @@ struct waiter_impl {
};
/* cache_waiter.c */
void
W
AIT_h
andle
(
struct
waiter
*
,
struct
waited
*
,
enum
wait_event
,
double
now
);
void
W
AIT
_UsePipe
(
struct
waiter
*
w
);
void
W
ait_H
andle
(
struct
waiter
*
,
struct
waited
*
,
enum
wait_event
,
double
now
);
void
W
ait
_UsePipe
(
struct
waiter
*
w
);
/* mgt_waiter.c */
extern
struct
waiter_impl
const
*
waiter
;
...
...
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