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
07b8a996
Commit
07b8a996
authored
Jan 13, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wean V1F_fetch_hdr() of struct vbc which should be and now is an
internal matter in cache_backend_*
parent
a6a74b19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
15 deletions
+12
-15
cache.h
bin/varnishd/cache/cache.h
+4
-0
cache_backend.c
bin/varnishd/cache/cache_backend.c
+5
-3
cache_backend.h
bin/varnishd/cache/cache_backend.h
+0
-4
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+3
-8
No files found.
bin/varnishd/cache/cache.h
View file @
07b8a996
...
...
@@ -242,6 +242,10 @@ struct http_conn {
enum
body_status
body_status
;
struct
vfp_ctx
vfc
[
1
];
struct
vbc
*
vbc
;
/* Timeouts */
double
first_byte_timeout
;
double
between_bytes_timeout
;
};
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_backend.c
View file @
07b8a996
...
...
@@ -322,8 +322,10 @@ vbe_dir_getfd(const struct director *d, struct busyobj *bo)
INIT_OBJ
(
bo
->
htc
,
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
);
FIND_TMO
(
first_byte_timeout
,
bo
->
htc
->
first_byte_timeout
,
bo
,
vs
->
vrt
);
FIND_TMO
(
between_bytes_timeout
,
bo
->
htc
->
between_bytes_timeout
,
bo
,
vs
->
vrt
);
return
(
vc
->
fd
);
}
...
...
@@ -400,7 +402,7 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
* that the backend closed it before we get a request to it.
* Do a single retry in that case.
*/
if
(
i
==
1
)
{
if
(
i
==
1
&&
bo
->
htc
->
vbc
->
recycled
)
{
vbe_dir_finish
(
d
,
wrk
,
bo
);
AZ
(
bo
->
htc
);
VSC_C_main
->
backend_retry
++
;
...
...
bin/varnishd/cache/cache_backend.h
View file @
07b8a996
...
...
@@ -94,10 +94,6 @@ struct vbc {
struct
suckaddr
*
addr
;
uint8_t
recycled
;
/* Timeouts */
double
first_byte_timeout
;
double
between_bytes_timeout
;
};
/* cache_backend.c */
...
...
bin/varnishd/http1/cache_http1_fetch.c
View file @
07b8a996
...
...
@@ -76,10 +76,9 @@ vbf_iter_req_body(struct req *req, void *priv, void *ptr, size_t l)
int
V1F_fetch_hdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
const
char
*
def_host
)
{
struct
vbc
*
vc
;
struct
http
*
hp
;
enum
http1_status_e
hs
;
int
retry
=
-
1
;
int
retry
=
1
;
int
i
,
j
,
first
;
struct
http_conn
*
htc
;
int
do_chunked
=
0
;
...
...
@@ -87,14 +86,10 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, const char *def_host)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
->
vbc
,
VBC_MAGIC
);
CHECK_OBJ_ORNULL
(
bo
->
req
,
REQ_MAGIC
);
htc
=
bo
->
htc
;
hp
=
bo
->
bereq
;
vc
=
htc
->
vbc
;
if
(
vc
->
recycled
)
retry
=
1
;
/*
* Now that we know our backend, we can set a default Host:
...
...
@@ -154,7 +149,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, const char *def_host)
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
VTCP_set_read_timeout
(
htc
->
fd
,
v
c
->
first_byte_timeout
);
VTCP_set_read_timeout
(
htc
->
fd
,
ht
c
->
first_byte_timeout
);
first
=
1
;
do
{
...
...
@@ -180,7 +175,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, const char *def_host)
retry
=
-
1
;
first
=
0
;
VTCP_set_read_timeout
(
htc
->
fd
,
v
c
->
between_bytes_timeout
);
ht
c
->
between_bytes_timeout
);
}
}
while
(
hs
!=
HTTP1_COMPLETE
);
bo
->
acct
.
beresp_hdrbytes
+=
htc
->
rxbuf_e
-
htc
->
rxbuf_b
;
...
...
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