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
59a3b914
Commit
59a3b914
authored
Dec 19, 2011
by
Per Buer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://git.varnish-cache.org/git/varnish-cache
parents
f111f6f2
ae3733fb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
39 deletions
+33
-39
cache.h
bin/varnishd/cache/cache.h
+6
-1
cache_center.c
bin/varnishd/cache/cache_center.c
+2
-2
cache_pool.c
bin/varnishd/cache/cache_pool.c
+0
-28
cache_waiter.c
bin/varnishd/waiter/cache_waiter.c
+25
-1
waiter.h
bin/varnishd/waiter/waiter.h
+0
-7
No files found.
bin/varnishd/cache/cache.h
View file @
59a3b914
...
...
@@ -868,7 +868,6 @@ void PipeSession(struct sess *sp);
/* cache_pool.c */
void
Pool_Init
(
void
);
void
Pool_Work_Thread
(
void
*
priv
,
struct
worker
*
w
);
void
Pool_Wait
(
struct
sess
*
sp
);
int
Pool_Schedule
(
struct
pool
*
pp
,
struct
sess
*
sp
);
#define WRW_IsReleased(w) ((w)->wrw.wfd == NULL)
...
...
@@ -893,6 +892,7 @@ void SES_Charge(struct sess *sp);
struct
sesspool
*
SES_NewPool
(
struct
pool
*
pp
);
void
SES_DeletePool
(
struct
sesspool
*
sp
,
struct
worker
*
wrk
);
int
SES_Schedule
(
struct
sess
*
sp
);
void
SES_Handle
(
struct
sess
*
sp
,
int
status
);
/* cache_shmlog.c */
...
...
@@ -964,6 +964,11 @@ void ESI_DeliverChild(const struct sess *);
/* cache_vrt_vmod.c */
void
VMOD_Init
(
void
);
/* cache_waiter.c */
void
WAIT_Enter
(
struct
sess
*
sp
);
void
WAIT_Init
(
void
);
const
char
*
WAIT_GetName
(
void
);
/* cache_wrk.c */
void
WRK_Init
(
void
);
...
...
bin/varnishd/cache/cache_center.c
View file @
59a3b914
...
...
@@ -121,7 +121,7 @@ cnt_wait(struct sess *sp)
WSP
(
sp
,
SLT_Debug
,
"herding"
);
wrk
->
stats
.
sess_herd
++
;
SES_Charge
(
sp
);
Pool_Wait
(
sp
);
WAIT_Enter
(
sp
);
return
(
1
);
}
if
(
i
==
1
)
{
...
...
@@ -432,7 +432,7 @@ WSP(sp, SLT_Debug, "PHK req %.9f resp %.9f end %.9f open %.9f",
return
(
0
);
}
wrk
->
stats
.
sess_herd
++
;
Pool_Wait
(
sp
);
WAIT_Enter
(
sp
);
return
(
1
);
}
...
...
bin/varnishd/cache/cache_pool.c
View file @
59a3b914
...
...
@@ -48,8 +48,6 @@
#include "cache.h"
#include "common/heritage.h"
#include "waiter/waiter.h"
#include "vtcp.h"
#include "vtim.h"
/*--------------------------------------------------------------------
...
...
@@ -82,8 +80,6 @@ pthread_condattr_setclock(pthread_condattr_t *attr, int foo)
}
#endif
/* !CLOCK_MONOTONIC */
static
void
*
waiter_priv
;
VTAILQ_HEAD
(
workerhead
,
worker
);
struct
poolsock
{
...
...
@@ -349,29 +345,6 @@ Pool_Schedule(struct pool *pp, struct sess *sp)
return
(
1
);
}
/*--------------------------------------------------------------------
* Wait for another request
*/
void
Pool_Wait
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
wrk
,
WORKER_MAGIC
);
AZ
(
sp
->
vcl
);
assert
(
sp
->
fd
>=
0
);
sp
->
wrk
=
NULL
;
/*
* Set nonblocking in the worker-thread, before passing to the
* acceptor thread, to reduce syscall density of the latter.
*/
if
(
VTCP_nonblocking
(
sp
->
fd
))
SES_Close
(
sp
,
"remote closed"
);
waiter
->
pass
(
waiter_priv
,
sp
);
}
/*--------------------------------------------------------------------
* Create another thread, if necessary & possible
*/
...
...
@@ -588,7 +561,6 @@ void
Pool_Init
(
void
)
{
waiter_priv
=
waiter
->
init
();
Lck_New
(
&
pool_mtx
,
lck_wq
);
AZ
(
pthread_create
(
&
thr_pool_herder
,
NULL
,
pool_poolherder
,
NULL
));
}
bin/varnishd/waiter/cache_waiter.c
View file @
59a3b914
...
...
@@ -33,10 +33,14 @@
#include <unistd.h>
#include <string.h>
#include "c
ommon/common
.h"
#include "c
ache/cache
.h"
#include "waiter/waiter.h"
#include "vtcp.h"
static
void
*
waiter_priv
;
const
char
*
WAIT_GetName
(
void
)
{
...
...
@@ -55,4 +59,24 @@ WAIT_Init(void)
AN
(
waiter
->
name
);
AN
(
waiter
->
init
);
AN
(
waiter
->
pass
);
waiter_priv
=
waiter
->
init
();
}
void
WAIT_Enter
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
wrk
,
WORKER_MAGIC
);
AZ
(
sp
->
vcl
);
assert
(
sp
->
fd
>=
0
);
sp
->
wrk
=
NULL
;
/*
* Set nonblocking in the worker-thread, before passing to the
* acceptor thread, to reduce syscall density of the latter.
*/
if
(
VTCP_nonblocking
(
sp
->
fd
))
SES_Close
(
sp
,
"remote closed"
);
waiter
->
pass
(
waiter_priv
,
sp
);
}
bin/varnishd/waiter/waiter.h
View file @
59a3b914
...
...
@@ -56,10 +56,3 @@ extern const struct waiter waiter_ports;
#endif
extern
const
struct
waiter
waiter_poll
;
/* cache_session.c */
void
SES_Handle
(
struct
sess
*
sp
,
int
status
);
/* cache_waiter.c */
const
char
*
WAIT_GetName
(
void
);
void
WAIT_Init
(
void
);
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