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
4e5828d8
Commit
4e5828d8
authored
Oct 13, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move vbc from bo to bo->htc
parent
7ffb0afa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
46 deletions
+47
-46
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_backend.c
bin/varnishd/cache/cache_backend.c
+32
-32
cache_busyobj.c
bin/varnishd/cache/cache_busyobj.c
+1
-1
cache_panic.c
bin/varnishd/cache/cache_panic.c
+2
-2
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+2
-2
cache_http1_pipe.c
bin/varnishd/http1/cache_http1_pipe.c
+9
-8
No files found.
bin/varnishd/cache/cache.h
View file @
4e5828d8
...
...
@@ -254,6 +254,7 @@ struct http_conn {
ssize_t
content_length
;
enum
body_status
body_status
;
struct
vfp_ctx
vfc
[
1
];
struct
vbc
*
vbc
;
};
/*--------------------------------------------------------------------*/
...
...
@@ -489,7 +490,6 @@ struct busyobj {
struct
ws
ws
[
1
];
char
*
ws_bo
;
struct
vbc
*
vbc
;
struct
http
*
bereq0
;
struct
http
*
bereq
;
struct
http
*
beresp
;
...
...
bin/varnishd/cache/cache_backend.c
View file @
4e5828d8
...
...
@@ -353,20 +353,20 @@ vbe_dir_getfd(const struct director *d, struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
CAST_OBJ_NOTNULL
(
vs
,
d
->
priv
,
VDI_SIMPLE_MAGIC
);
AZ
(
bo
->
htc
);
bo
->
htc
=
WS_Alloc
(
bo
->
ws
,
sizeof
*
bo
->
htc
);
memset
(
bo
->
htc
,
0
,
sizeof
*
bo
->
htc
);
bo
->
htc
->
magic
=
HTTP_CONN_MAGIC
;
vc
=
vbe_GetVbe
(
bo
,
vs
);
if
(
vc
!=
NULL
)
{
FIND_TMO
(
first_byte_timeout
,
vc
->
first_byte_timeout
,
bo
,
vs
->
vrt
);
FIND_TMO
(
between_bytes_timeout
,
vc
->
between_bytes_timeout
,
bo
,
vs
->
vrt
);
}
if
(
vc
==
NULL
)
if
(
vc
==
NULL
)
{
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"no backend connection"
);
return
(
NULL
);
}
if
(
bo
->
htc
==
NULL
)
bo
->
htc
=
WS_Alloc
(
bo
->
ws
,
sizeof
*
bo
->
htc
);
memset
(
bo
->
htc
,
0
,
sizeof
*
bo
->
htc
);
bo
->
htc
->
magic
=
HTTP_CONN_MAGIC
;
bo
->
htc
->
vbc
=
vc
;
bo
->
htc
->
fd
=
vc
->
fd
;
FIND_TMO
(
first_byte_timeout
,
vc
->
first_byte_timeout
,
bo
,
vs
->
vrt
);
FIND_TMO
(
between_bytes_timeout
,
vc
->
between_bytes_timeout
,
bo
,
vs
->
vrt
);
return
(
vc
);
}
...
...
@@ -388,15 +388,15 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
struct
busyobj
*
bo
)
{
int
i
;
struct
vbc
*
vbc
;
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
bo
->
vbc
=
vbe_dir_getfd
(
d
,
bo
);
if
(
bo
->
vbc
==
NULL
)
{
vbc
=
vbe_dir_getfd
(
d
,
bo
);
if
(
vbc
==
NULL
)
{
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"no backend connection"
);
bo
->
htc
=
NULL
;
return
(
-
1
);
}
...
...
@@ -407,11 +407,11 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
* Do a single retry in that case.
*/
if
(
i
==
1
)
{
AZ
(
bo
->
vb
c
);
AZ
(
bo
->
ht
c
);
VSC_C_main
->
backend_retry
++
;
bo
->
doclose
=
SC_NULL
;
bo
->
vbc
=
vbe_dir_getfd
(
d
,
bo
);
if
(
bo
->
vbc
==
NULL
)
{
bo
->
htc
->
vbc
=
vbe_dir_getfd
(
d
,
bo
);
if
(
bo
->
htc
->
vbc
==
NULL
)
{
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"no backend connection"
);
bo
->
htc
=
NULL
;
return
(
-
1
);
...
...
@@ -420,9 +420,9 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
}
if
(
i
!=
0
)
{
bo
->
doclose
=
SC_NULL
;
AZ
(
bo
->
vb
c
);
AZ
(
bo
->
ht
c
);
}
else
{
AN
(
bo
->
vbc
);
AN
(
bo
->
htc
->
vbc
);
}
return
(
i
);
}
...
...
@@ -451,26 +451,26 @@ vbe_dir_finish(const struct director *d, struct worker *wrk,
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
bo
->
htc
=
NULL
;
if
(
bo
->
vbc
==
NULL
)
if
(
bo
->
htc
->
vbc
==
NULL
)
return
;
bp
=
bo
->
vbc
->
backend
;
bp
=
bo
->
htc
->
vbc
->
backend
;
if
(
bo
->
doclose
!=
SC_NULL
)
{
VSLb
(
bo
->
vsl
,
SLT_BackendClose
,
"%d %s"
,
bo
->
vbc
->
fd
,
VSLb
(
bo
->
vsl
,
SLT_BackendClose
,
"%d %s"
,
bo
->
htc
->
vbc
->
fd
,
bp
->
display_name
);
VTCP_close
(
&
bo
->
vbc
->
fd
);
VTCP_close
(
&
bo
->
htc
->
vbc
->
fd
);
VBE_DropRefConn
(
bp
,
&
bo
->
acct
);
bo
->
vbc
->
backend
=
NULL
;
VBE_ReleaseConn
(
bo
->
vbc
);
bo
->
htc
->
vbc
->
backend
=
NULL
;
VBE_ReleaseConn
(
bo
->
htc
->
vbc
);
}
else
{
VSLb
(
bo
->
vsl
,
SLT_BackendReuse
,
"%d %s"
,
bo
->
vbc
->
fd
,
VSLb
(
bo
->
vsl
,
SLT_BackendReuse
,
"%d %s"
,
bo
->
htc
->
vbc
->
fd
,
bp
->
display_name
);
Lck_Lock
(
&
bp
->
mtx
);
VSC_C_main
->
backend_recycle
++
;
VTAILQ_INSERT_HEAD
(
&
bp
->
connlist
,
bo
->
vbc
,
list
);
VTAILQ_INSERT_HEAD
(
&
bp
->
connlist
,
bo
->
htc
->
vbc
,
list
);
VBE_DropRefLocked
(
bp
,
&
bo
->
acct
);
}
bo
->
vbc
=
NULL
;
bo
->
htc
->
vbc
=
NULL
;
bo
->
htc
=
NULL
;
}
static
struct
suckaddr
*
__match_proto__
(
vdi_suckaddr_f
)
...
...
@@ -481,8 +481,8 @@ vbe_dir_suckaddr(const struct director *d, struct worker *wrk,
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
if
(
bo
->
vbc
!=
NULL
)
return
(
bo
->
vbc
->
addr
);
if
(
bo
->
htc
->
vbc
!=
NULL
)
return
(
bo
->
htc
->
vbc
->
addr
);
return
(
NULL
);
}
...
...
bin/varnishd/cache/cache_busyobj.c
View file @
4e5828d8
...
...
@@ -200,7 +200,7 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
VSL_End
(
bo
->
vsl
);
AZ
(
bo
->
vb
c
);
AZ
(
bo
->
ht
c
);
if
(
bo
->
fetch_objcore
!=
NULL
)
{
AN
(
wrk
);
...
...
bin/varnishd/cache/cache_panic.c
View file @
4e5828d8
...
...
@@ -338,8 +338,8 @@ pan_busyobj(const struct busyobj *bo)
VSB_printf
(
pan_vsp
,
"
\n
"
);
}
VSB_printf
(
pan_vsp
,
" },
\n
"
);
if
(
VALID_OBJ
(
bo
->
vbc
,
BACKEND_MAGIC
))
pan_vbc
(
bo
->
vbc
);
if
(
VALID_OBJ
(
bo
->
htc
->
vbc
,
BACKEND_MAGIC
))
pan_vbc
(
bo
->
htc
->
vbc
);
if
(
bo
->
bereq
->
ws
!=
NULL
)
pan_http
(
"bereq"
,
bo
->
bereq
,
4
);
if
(
bo
->
beresp
->
ws
!=
NULL
)
...
...
bin/varnishd/http1/cache_http1_fetch.c
View file @
4e5828d8
...
...
@@ -88,12 +88,12 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
vbc
,
VBC_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
->
vbc
,
VBC_MAGIC
);
CHECK_OBJ_ORNULL
(
bo
->
req
,
REQ_MAGIC
);
htc
=
bo
->
htc
;
hp
=
bo
->
bereq
;
vc
=
bo
->
vbc
;
vc
=
htc
->
vbc
;
if
(
vc
->
recycled
)
retry
=
1
;
...
...
bin/varnishd/http1/cache_http1_pipe.c
View file @
4e5828d8
...
...
@@ -120,12 +120,13 @@ V1P_Process(struct req *req, struct busyobj *bo)
SES_Close
(
req
->
sp
,
SC_OVERLOAD
);
return
;
}
bo
->
vbc
=
vc
;
/* For panic dumping */
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
assert
(
bo
->
htc
->
fd
>=
0
);
bo
->
wrk
=
req
->
wrk
;
bo
->
director_state
=
DIR_S_BODY
;
(
void
)
VTCP_blocking
(
v
c
->
fd
);
(
void
)
VTCP_blocking
(
bo
->
ht
c
->
fd
);
WRW_Reserve
(
wrk
,
&
v
c
->
fd
,
bo
->
vsl
,
req
->
t_req
);
WRW_Reserve
(
wrk
,
&
bo
->
ht
c
->
fd
,
bo
->
vsl
,
req
->
t_req
);
hdrbytes
=
HTTP1_Write
(
wrk
,
bo
->
bereq
,
HTTP1_Req
);
if
(
req
->
htc
->
pipeline_b
!=
NULL
)
...
...
@@ -142,7 +143,7 @@ V1P_Process(struct req *req, struct busyobj *bo)
if
(
i
==
0
)
{
memset
(
fds
,
0
,
sizeof
fds
);
fds
[
0
].
fd
=
v
c
->
fd
;
fds
[
0
].
fd
=
bo
->
ht
c
->
fd
;
fds
[
0
].
events
=
POLLIN
|
POLLERR
;
fds
[
1
].
fd
=
req
->
sp
->
fd
;
fds
[
1
].
events
=
POLLIN
|
POLLERR
;
...
...
@@ -155,20 +156,20 @@ V1P_Process(struct req *req, struct busyobj *bo)
if
(
i
<
1
)
break
;
if
(
fds
[
0
].
revents
&&
rdf
(
v
c
->
fd
,
req
->
sp
->
fd
,
&
acct_pipe
.
out
))
{
rdf
(
bo
->
ht
c
->
fd
,
req
->
sp
->
fd
,
&
acct_pipe
.
out
))
{
if
(
fds
[
1
].
fd
==
-
1
)
break
;
(
void
)
shutdown
(
v
c
->
fd
,
SHUT_RD
);
(
void
)
shutdown
(
bo
->
ht
c
->
fd
,
SHUT_RD
);
(
void
)
shutdown
(
req
->
sp
->
fd
,
SHUT_WR
);
fds
[
0
].
events
=
0
;
fds
[
0
].
fd
=
-
1
;
}
if
(
fds
[
1
].
revents
&&
rdf
(
req
->
sp
->
fd
,
v
c
->
fd
,
&
acct_pipe
.
in
))
{
rdf
(
req
->
sp
->
fd
,
bo
->
ht
c
->
fd
,
&
acct_pipe
.
in
))
{
if
(
fds
[
0
].
fd
==
-
1
)
break
;
(
void
)
shutdown
(
req
->
sp
->
fd
,
SHUT_RD
);
(
void
)
shutdown
(
v
c
->
fd
,
SHUT_WR
);
(
void
)
shutdown
(
bo
->
ht
c
->
fd
,
SHUT_WR
);
fds
[
1
].
events
=
0
;
fds
[
1
].
fd
=
-
1
;
}
...
...
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