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
f4a64133
Commit
f4a64133
authored
Jun 05, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcp: move open calls to VCP function, use function pointers
parent
c66a5a26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
cache_tcp_pool.c
bin/varnishd/cache/cache_tcp_pool.c
+19
-8
No files found.
bin/varnishd/cache/cache_tcp_pool.c
View file @
f4a64133
...
...
@@ -368,6 +368,21 @@ VCP_Recycle(const struct worker *wrk, struct pfd **pfdp)
}
}
/*--------------------------------------------------------------------
* Open a new connection from pool.
*/
static
int
VCP_Open
(
const
struct
conn_pool
*
cp
,
double
tmo
,
const
void
**
privp
)
{
int
r
;
CHECK_OBJ_NOTNULL
(
cp
,
CONN_POOL_MAGIC
);
r
=
cp
->
methods
->
open
(
cp
,
tmo
,
privp
);
return
(
r
);
}
/*--------------------------------------------------------------------
* Close a connection.
...
...
@@ -406,7 +421,7 @@ VCP_Close(struct pfd **pfdp)
}
/*--------------------------------------------------------------------
* Get a connection
* Get a connection
, possibly recycled
*/
static
struct
pfd
*
...
...
@@ -444,7 +459,7 @@ VCP_Get(struct conn_pool *cp, double tmo, struct worker *wrk,
INIT_OBJ
(
pfd
->
waited
,
WAITED_MAGIC
);
pfd
->
state
=
PFD_STATE_USED
;
pfd
->
conn_pool
=
cp
;
pfd
->
fd
=
cp
->
methods
->
o
pen
(
cp
,
tmo
,
&
pfd
->
priv
);
pfd
->
fd
=
VCP_O
pen
(
cp
,
tmo
,
&
pfd
->
priv
);
if
(
pfd
->
fd
<
0
)
{
FREE_OBJ
(
pfd
);
Lck_Lock
(
&
cp
->
mtx
);
...
...
@@ -718,17 +733,13 @@ VTP_Rel(struct tcp_pool **tpp)
}
/*--------------------------------------------------------------------
* Open a new connection from pool. This is a distinct function since
* probing cannot use a recycled connection.
* Open a new connection from pool.
*/
int
VTP_Open
(
const
struct
tcp_pool
*
tp
,
double
tmo
,
const
void
**
privp
)
{
if
(
tp
->
uds
!=
NULL
)
return
(
vus_open
(
tp
->
cp
,
tmo
,
privp
));
return
(
vtp_open
(
tp
->
cp
,
tmo
,
privp
));
return
(
VCP_Open
(
tp
->
cp
,
tmo
,
privp
));
}
/*--------------------------------------------------------------------
...
...
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