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
b477c377
Commit
b477c377
authored
Apr 05, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce SES_Ref() and SES_Rel(), so we can start to decorate
the code with them.
parent
82c21f91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
1 deletion
+34
-1
cache.h
bin/varnishd/cache/cache.h
+3
-1
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+2
-0
cache_priv.h
bin/varnishd/cache/cache_priv.h
+3
-0
cache_session.c
bin/varnishd/cache/cache_session.c
+26
-0
No files found.
bin/varnishd/cache/cache.h
View file @
b477c377
...
...
@@ -634,6 +634,7 @@ struct sess {
#define SESS_MAGIC 0x2c2f9c5a
uint16_t
sattr
[
SA_LAST
];
int
refcnt
;
int
fd
;
uint32_t
vxid
;
...
...
@@ -944,7 +945,8 @@ struct sess *SES_New(struct pool *);
void
SES_Close
(
struct
sess
*
,
enum
sess_close
reason
);
void
SES_Wait
(
struct
sess
*
,
const
struct
transport
*
);
void
SES_Delete
(
struct
sess
*
,
enum
sess_close
reason
,
double
now
);
void
SES_NewPool
(
struct
pool
*
,
unsigned
pool_no
);
void
SES_Ref
(
struct
sess
*
sp
);
void
SES_Rel
(
struct
sess
*
sp
);
int
SES_Reschedule_Req
(
struct
req
*
);
void
SES_SetTransport
(
struct
worker
*
,
struct
sess
*
,
struct
req
*
,
const
struct
transport
*
);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
b477c377
...
...
@@ -89,6 +89,7 @@ ved_include(struct req *preq, const char *src, const char *host,
return
;
req
=
Req_New
(
wrk
,
preq
->
sp
);
SES_Ref
(
preq
->
sp
);
req
->
req_body_status
=
REQ_BODY_NONE
;
AZ
(
req
->
vsl
->
wid
);
req
->
vsl
->
wid
=
VXID_Get
(
wrk
,
VSL_CLIENTMARKER
);
...
...
@@ -182,6 +183,7 @@ ved_include(struct req *preq, const char *src, const char *host,
req
->
wrk
=
NULL
;
THR_SetRequest
(
preq
);
SES_Rel
(
req
->
sp
);
Req_Release
(
req
);
}
...
...
bin/varnishd/cache/cache_priv.h
View file @
b477c377
...
...
@@ -95,6 +95,9 @@ void Pool_Init(void);
/* cache_proxy.c [VPX] */
task_func_t
VPX_Proto_Sess
;
/* cache_session.c */
void
SES_NewPool
(
struct
pool
*
,
unsigned
pool_no
);
/* cache_shmlog.c */
void
VSM_Init
(
void
);
void
VSL_Setup
(
struct
vsl_log
*
vsl
,
void
*
ptr
,
size_t
len
);
...
...
bin/varnishd/cache/cache_session.c
View file @
b477c377
...
...
@@ -325,6 +325,7 @@ SES_New(struct pool *pp)
sp
=
MPL_Get
(
pp
->
mpl_sess
,
&
sz
);
sp
->
magic
=
SESS_MAGIC
;
sp
->
pool
=
pp
;
sp
->
refcnt
=
1
;
memset
(
sp
->
sattr
,
0xff
,
sizeof
sp
->
sattr
);
e
=
(
char
*
)
sp
+
sz
;
...
...
@@ -533,6 +534,31 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
MPL_Free
(
pp
->
mpl_sess
,
sp
);
}
/*--------------------------------------------------------------------
*/
void
SES_Ref
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
Lck_Lock
(
&
sp
->
mtx
);
assert
(
sp
->
refcnt
>
0
);
sp
->
refcnt
++
;
Lck_Unlock
(
&
sp
->
mtx
);
}
void
SES_Rel
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
Lck_Lock
(
&
sp
->
mtx
);
assert
(
sp
->
refcnt
>
0
);
sp
->
refcnt
--
;
Lck_Unlock
(
&
sp
->
mtx
);
}
/*--------------------------------------------------------------------
* Create and delete pools
*/
...
...
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