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
155f11a4
Commit
155f11a4
authored
Jan 07, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding the default Host: header is a matter between the backend
and V1F, it has nothing to do with the VDI layer.
parent
57ff5102
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
21 deletions
+8
-21
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_backend.c
bin/varnishd/cache/cache_backend.c
+4
-15
cache_director.c
bin/varnishd/cache/cache_director.c
+0
-1
cache_director.h
bin/varnishd/cache/cache_director.h
+0
-1
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+3
-3
No files found.
bin/varnishd/cache/cache.h
View file @
155f11a4
...
...
@@ -717,7 +717,7 @@ void VBO_waitstate(struct busyobj *bo, enum busyobj_state_e want);
/* cache_http1_fetch.c [V1F] */
int
V1F_fetch_hdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
);
int
V1F_fetch_hdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
const
char
*
def_host
);
void
V1F_Setup_Fetch
(
struct
vfp_ctx
*
vfc
,
struct
http_conn
*
htc
);
/* cache_http1_fsm.c [HTTP1] */
...
...
bin/varnishd/cache/cache_backend.c
View file @
155f11a4
...
...
@@ -62,19 +62,6 @@ struct vbe_dir {
const
struct
vrt_backend
*
vrt
;
};
/*--------------------------------------------------------------------
* Create default Host: header for backend request
*/
void
VDI_AddHostHeader
(
struct
http
*
hp
,
const
struct
vbc
*
vbc
)
{
CHECK_OBJ_NOTNULL
(
vbc
,
VBC_MAGIC
);
CHECK_OBJ_NOTNULL
(
vbc
->
vdis
,
VDI_SIMPLE_MAGIC
);
http_PrintfHeader
(
hp
,
"Host: %s"
,
vbc
->
vdis
->
vrt
->
hosthdr
);
}
/*--------------------------------------------------------------------*/
/* Private interface from backend_cfg.c */
...
...
@@ -425,10 +412,12 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
struct
busyobj
*
bo
)
{
int
i
;
struct
vbe_dir
*
vs
;
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CAST_OBJ_NOTNULL
(
vs
,
d
->
priv
,
VDI_SIMPLE_MAGIC
);
i
=
vbe_dir_getfd
(
d
,
bo
);
if
(
i
<
0
)
{
...
...
@@ -437,7 +426,7 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
}
AN
(
bo
->
htc
);
i
=
V1F_fetch_hdr
(
wrk
,
bo
);
i
=
V1F_fetch_hdr
(
wrk
,
bo
,
vs
->
vrt
->
hosthdr
);
/*
* If we recycle a backend connection, there is a finite chance
* that the backend closed it before we get a request to it.
...
...
@@ -455,7 +444,7 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
return
(
-
1
);
}
AN
(
bo
->
htc
);
i
=
V1F_fetch_hdr
(
wrk
,
bo
);
i
=
V1F_fetch_hdr
(
wrk
,
bo
,
vs
->
vrt
->
hosthdr
);
}
if
(
i
!=
0
)
{
vbe_dir_finish
(
d
,
wrk
,
bo
);
...
...
bin/varnishd/cache/cache_director.c
View file @
155f11a4
...
...
@@ -37,7 +37,6 @@
#include "cache.h"
// #include "cache_backend.h"
#include "cache_director.h"
/* Resolve director --------------------------------------------------*/
...
...
bin/varnishd/cache/cache_director.h
View file @
155f11a4
...
...
@@ -74,6 +74,5 @@ int VDI_GetBody(struct worker *wrk, struct busyobj *bo);
void
VDI_Finish
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
);
int
VDI_GetHttp1Fd
(
struct
worker
*
wrk
,
struct
busyobj
*
);
int
VDI_Healthy
(
const
struct
director
*
,
const
struct
busyobj
*
);
void
VDI_AddHostHeader
(
struct
http
*
to
,
const
struct
vbc
*
vbc
);
void
VBE_Init
(
void
);
bin/varnishd/http1/cache_http1_fetch.c
View file @
155f11a4
...
...
@@ -74,7 +74,7 @@ vbf_iter_req_body(struct req *req, void *priv, void *ptr, size_t l)
*/
int
V1F_fetch_hdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
)
V1F_fetch_hdr
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
const
char
*
def_host
)
{
struct
vbc
*
vc
;
struct
http
*
hp
;
...
...
@@ -101,8 +101,8 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
* header if one is necessary. This cannot be done in the VCL
* because the backend may be chosen by a director.
*/
if
(
!
http_GetHdr
(
bo
->
bereq
,
H_Host
,
NULL
))
VDI_AddHostHeader
(
bo
->
bereq
,
vc
);
if
(
!
http_GetHdr
(
bo
->
bereq
,
H_Host
,
NULL
)
&&
def_host
!=
NULL
)
http_PrintfHeader
(
hp
,
"Host: %s"
,
def_host
);
if
(
bo
->
req
!=
NULL
&&
bo
->
req
->
req_body_status
==
REQ_BODY_WITHOUT_LEN
)
{
...
...
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