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
5647c265
Commit
5647c265
authored
May 13, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the "need_host_hdr" test to cache_fetch.c
parent
8e8a8942
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
cache.h
bin/varnishd/cache/cache.h
+1
-2
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+4
-2
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+3
-6
No files found.
bin/varnishd/cache/cache.h
View file @
5647c265
...
@@ -815,8 +815,7 @@ void EXP_NukeLRU(struct worker *wrk, struct vsl_log *vsl, struct lru *lru);
...
@@ -815,8 +815,7 @@ void EXP_NukeLRU(struct worker *wrk, struct vsl_log *vsl, struct lru *lru);
struct
storage
*
FetchStorage
(
struct
busyobj
*
,
ssize_t
sz
);
struct
storage
*
FetchStorage
(
struct
busyobj
*
,
ssize_t
sz
);
int
FetchError
(
struct
busyobj
*
,
const
char
*
error
);
int
FetchError
(
struct
busyobj
*
,
const
char
*
error
);
int
FetchError2
(
struct
busyobj
*
,
const
char
*
error
,
const
char
*
more
);
int
FetchError2
(
struct
busyobj
*
,
const
char
*
error
,
const
char
*
more
);
int
FetchHdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
struct
req
*
req
,
int
FetchHdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
struct
req
*
req
);
int
need_host_hdr
);
void
FetchBody
(
struct
worker
*
w
,
void
*
bo
);
void
FetchBody
(
struct
worker
*
w
,
void
*
bo
);
void
Fetch_Init
(
void
);
void
Fetch_Init
(
void
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
5647c265
...
@@ -357,8 +357,7 @@ fetch_iter_req_body(struct req *req, void *priv, void *ptr, size_t l)
...
@@ -357,8 +357,7 @@ fetch_iter_req_body(struct req *req, void *priv, void *ptr, size_t l)
*/
*/
int
int
FetchHdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
struct
req
*
req
,
FetchHdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
struct
req
*
req
)
int
need_host_hdr
)
{
{
struct
vbc
*
vc
;
struct
vbc
*
vc
;
struct
http
*
hp
;
struct
http
*
hp
;
...
@@ -366,6 +365,7 @@ FetchHdr(struct worker *wrk, struct busyobj *bo, struct req *req,
...
@@ -366,6 +365,7 @@ FetchHdr(struct worker *wrk, struct busyobj *bo, struct req *req,
int
retry
=
-
1
;
int
retry
=
-
1
;
int
i
,
first
;
int
i
,
first
;
struct
http_conn
*
htc
;
struct
http_conn
*
htc
;
int
need_host_hdr
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_ORNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_ORNULL
(
req
,
REQ_MAGIC
);
...
@@ -374,6 +374,8 @@ FetchHdr(struct worker *wrk, struct busyobj *bo, struct req *req,
...
@@ -374,6 +374,8 @@ FetchHdr(struct worker *wrk, struct busyobj *bo, struct req *req,
AN
(
bo
->
director
);
AN
(
bo
->
director
);
need_host_hdr
=
!
http_GetHdr
(
bo
->
bereq
,
H_Host
,
NULL
);
hp
=
bo
->
bereq
;
hp
=
bo
->
bereq
;
bo
->
vbc
=
VDI_GetFd
(
NULL
,
bo
);
bo
->
vbc
=
VDI_GetFd
(
NULL
,
bo
);
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
5647c265
...
@@ -350,7 +350,7 @@ DOT fetch -> fetchbody [style=bold,color=blue]
...
@@ -350,7 +350,7 @@ DOT fetch -> fetchbody [style=bold,color=blue]
static
enum
req_fsm_nxt
static
enum
req_fsm_nxt
cnt_fetch
(
struct
worker
*
wrk
,
struct
req
*
req
)
cnt_fetch
(
struct
worker
*
wrk
,
struct
req
*
req
)
{
{
int
i
,
need_host_hdr
;
int
i
;
struct
busyobj
*
bo
;
struct
busyobj
*
bo
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
...
@@ -367,12 +367,9 @@ cnt_fetch(struct worker *wrk, struct req *req)
...
@@ -367,12 +367,9 @@ cnt_fetch(struct worker *wrk, struct req *req)
HTTP_Setup
(
bo
->
beresp
,
bo
->
ws
,
bo
->
vsl
,
HTTP_Beresp
);
HTTP_Setup
(
bo
->
beresp
,
bo
->
ws
,
bo
->
vsl
,
HTTP_Beresp
);
need_host_hdr
=
!
http_GetHdr
(
bo
->
bereq
,
H_Host
,
NULL
);
req
->
acct_req
.
fetch
++
;
req
->
acct_req
.
fetch
++
;
i
=
FetchHdr
(
wrk
,
bo
,
req
->
objcore
->
objhead
==
NULL
?
req
:
NULL
,
i
=
FetchHdr
(
wrk
,
bo
,
req
->
objcore
->
objhead
==
NULL
?
req
:
NULL
);
need_host_hdr
);
/*
/*
* If we recycle a backend connection, there is a finite chance
* If we recycle a backend connection, there is a finite chance
* that the backend closed it before we get a request to it.
* that the backend closed it before we get a request to it.
...
@@ -381,7 +378,7 @@ cnt_fetch(struct worker *wrk, struct req *req)
...
@@ -381,7 +378,7 @@ cnt_fetch(struct worker *wrk, struct req *req)
if
(
i
==
1
)
{
if
(
i
==
1
)
{
VSC_C_main
->
backend_retry
++
;
VSC_C_main
->
backend_retry
++
;
i
=
FetchHdr
(
wrk
,
bo
,
i
=
FetchHdr
(
wrk
,
bo
,
req
->
objcore
->
objhead
==
NULL
?
req
:
NULL
,
need_host_hdr
);
req
->
objcore
->
objhead
==
NULL
?
req
:
NULL
);
}
}
if
(
req
->
objcore
->
objhead
!=
NULL
)
if
(
req
->
objcore
->
objhead
!=
NULL
)
...
...
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