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
1f4006e8
Commit
1f4006e8
authored
Jul 16, 2012
by
Dag Haavi Finstad
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '3.0' of
ssh://git.varnish-cache.org/git/varnish-cache
into 3.0
parents
b50bbd6f
b164c06c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
cache_session.c
bin/varnishd/cache_session.c
+13
-5
No files found.
bin/varnishd/cache_session.c
View file @
1f4006e8
...
...
@@ -74,6 +74,8 @@ static struct lock ses_mem_mtx;
/*--------------------------------------------------------------------*/
static
struct
lock
stat_mtx
;
static
volatile
uint64_t
n_sess_grab
=
0
;
static
uint64_t
n_sess_rel
=
0
;
/*--------------------------------------------------------------------*/
...
...
@@ -214,7 +216,8 @@ SES_New(void)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
}
VSC_C_main
->
n_sess
++
;
/* XXX: locking ? */
/* Only updated from the cache acceptor - no lock needed */
n_sess_grab
++
;
return
(
sp
);
}
...
...
@@ -255,7 +258,6 @@ SES_Delete(struct sess *sp)
AZ
(
sp
->
obj
);
AZ
(
sp
->
vcl
);
VSC_C_main
->
n_sess
--
;
/* XXX: locking ? */
assert
(
!
isnan
(
b
->
first
));
assert
(
!
isnan
(
sp
->
t_end
));
if
(
sp
->
addr
==
NULL
)
...
...
@@ -267,10 +269,8 @@ SES_Delete(struct sess *sp)
b
->
sess
,
b
->
req
,
b
->
pipe
,
b
->
pass
,
b
->
fetch
,
b
->
hdrbytes
,
b
->
bodybytes
);
if
(
sm
->
workspace
!=
params
->
sess_workspace
)
{
Lck_Lock
(
&
stat_mtx
);
VSC_C_main
->
n_sess_mem
--
;
Lck_Unlock
(
&
stat_mtx
);
free
(
sm
);
sm
=
NULL
;
}
else
{
/* Clean and prepare for reuse */
ses_setup
(
sm
);
...
...
@@ -279,6 +279,14 @@ SES_Delete(struct sess *sp)
Lck_Unlock
(
&
ses_mem_mtx
);
}
/* Update statistics */
Lck_Lock
(
&
stat_mtx
);
if
(
sm
==
NULL
)
VSC_C_main
->
n_sess_mem
--
;
n_sess_rel
++
;
VSC_C_main
->
n_sess
=
n_sess_grab
-
n_sess_rel
;
Lck_Unlock
(
&
stat_mtx
);
/* Try to precreate some ses-mem so the acceptor will not have to */
if
(
VSC_C_main
->
n_sess_mem
<
VSC_C_main
->
n_sess
+
10
)
{
sm
=
ses_sm_alloc
();
...
...
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