Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
ac787244
Commit
ac787244
authored
Jan 23, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the freshly acceptted session code from cache_pool.c to
cache_session.c
parent
69256c8e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
16 deletions
+35
-16
cache.h
bin/varnishd/cache/cache.h
+1
-2
cache_pool.c
bin/varnishd/cache/cache_pool.c
+5
-12
cache_session.c
bin/varnishd/cache/cache_session.c
+29
-2
No files found.
bin/varnishd/cache/cache.h
View file @
ac787244
...
...
@@ -928,7 +928,6 @@ void WRW_Sendfile(struct worker *w, int fd, off_t off, unsigned len);
#endif
/* SENDFILE_WORKS */
/* cache_session.c [SES] */
struct
sess
*
SES_New
(
struct
sesspool
*
pp
);
struct
sess
*
SES_Alloc
(
void
);
void
SES_Close
(
struct
sess
*
sp
,
const
char
*
reason
);
void
SES_Delete
(
struct
sess
*
sp
,
const
char
*
reason
,
double
now
);
...
...
@@ -940,7 +939,7 @@ void SES_Handle(struct sess *sp, double now);
void
SES_GetReq
(
struct
sess
*
sp
);
void
SES_ReleaseReq
(
struct
sess
*
sp
);
pool_func_t
SES_pool_task
;
pool_func_t
SES_pool_accept_task
;
/* cache_shmlog.c */
extern
struct
VSC_C_main
*
VSC_C_main
;
...
...
bin/varnishd/cache/cache_pool.c
View file @
ac787244
...
...
@@ -190,7 +190,8 @@ pool_accept(struct pool *pp, struct worker *wrk, const struct poolsock *ps)
assert
(
sizeof
*
wa2
==
WS_Reserve
(
wrk2
->
ws
,
sizeof
*
wa2
));
wa2
=
(
void
*
)
wrk2
->
ws
->
f
;
memcpy
(
wa2
,
wa
,
sizeof
*
wa
);
wrk2
->
do_what
=
pool_do_accept
;
wrk2
->
task
.
func
=
SES_pool_accept_task
;
wrk2
->
task
.
priv
=
pp
->
sesspool
;
AZ
(
pthread_cond_signal
(
&
wrk2
->
cond
));
}
}
...
...
@@ -342,19 +343,11 @@ Pool_Work_Thread(void *priv, struct worker *wrk)
Lck_Unlock
(
&
pp
->
mtx
);
if
(
wrk
->
do_what
==
pool_do_accept
)
{
/* Turn accepted socket into a session */
AZ
(
wrk
->
sp
);
AN
(
wrk
->
ws
->
r
);
wrk
->
sp
=
SES_New
(
pp
->
sesspool
);
if
(
wrk
->
sp
==
NULL
)
{
VCA_FailSess
(
wrk
);
SES_pool_accept_task
(
wrk
,
pp
->
sesspool
);
if
(
wrk
->
sp
==
NULL
)
wrk
->
do_what
=
pool_do_nothing
;
}
else
{
VCA_SetupSess
(
wrk
);
wrk
->
sp
->
step
=
STP_FIRST
;
else
wrk
->
do_what
=
pool_do_sess
;
}
WS_Release
(
wrk
->
ws
,
0
);
}
if
(
wrk
->
do_what
==
pool_do_sess
)
{
...
...
bin/varnishd/cache/cache_session.c
View file @
ac787244
...
...
@@ -97,8 +97,8 @@ ses_setup(struct sess *sp)
* Get a new session, preferably by recycling an already ready one
*/
struct
sess
*
SES_N
ew
(
struct
sesspool
*
pp
)
st
atic
st
ruct
sess
*
ses_n
ew
(
struct
sesspool
*
pp
)
{
struct
sess
*
sp
;
...
...
@@ -127,6 +127,33 @@ SES_Alloc(void)
return
(
sp
);
}
/*--------------------------------------------------------------------
* The pool-task for a newly accepted session
*/
void
SES_pool_accept_task
(
struct
worker
*
wrk
,
void
*
arg
)
{
struct
sesspool
*
pp
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CAST_OBJ_NOTNULL
(
pp
,
arg
,
SESSPOOL_MAGIC
);
/* Turn accepted socket into a session */
AZ
(
wrk
->
sp
);
AN
(
wrk
->
ws
->
r
);
wrk
->
sp
=
ses_new
(
pp
);
if
(
wrk
->
sp
==
NULL
)
{
VCA_FailSess
(
wrk
);
return
;
}
VCA_SetupSess
(
wrk
);
wrk
->
sp
->
step
=
STP_FIRST
;
WS_Release
(
wrk
->
ws
,
0
);
SES_pool_task
(
wrk
,
wrk
->
sp
);
}
/*--------------------------------------------------------------------
* The pool-task function for sessions
...
...
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