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
a3c3e4ef
Commit
a3c3e4ef
authored
Jan 27, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have http_conn point to the fd rather than carry a copy
parent
42fb7e96
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
18 additions
and
14 deletions
+18
-14
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_acceptor.c
bin/varnishd/cache/cache_acceptor.c
+1
-1
cache_backend.c
bin/varnishd/cache/cache_backend.c
+1
-1
cache_panic.c
bin/varnishd/cache/cache_panic.c
+2
-1
cache_req.c
bin/varnishd/cache/cache_req.c
+0
-1
cache_session.c
bin/varnishd/cache/cache_session.c
+3
-1
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+6
-4
cache_http1_fsm.c
bin/varnishd/http1/cache_http1_fsm.c
+1
-1
cache_http1_vfp.c
bin/varnishd/http1/cache_http1_vfp.c
+1
-1
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+2
-2
No files found.
bin/varnishd/cache/cache.h
View file @
a3c3e4ef
...
@@ -218,7 +218,7 @@ struct http_conn {
...
@@ -218,7 +218,7 @@ struct http_conn {
unsigned
magic
;
unsigned
magic
;
#define HTTP_CONN_MAGIC 0x3e19edd1
#define HTTP_CONN_MAGIC 0x3e19edd1
int
fd
;
int
*
r
fd
;
enum
sess_close
doclose
;
enum
sess_close
doclose
;
enum
body_status
body_status
;
enum
body_status
body_status
;
struct
ws
*
ws
;
struct
ws
*
ws
;
...
...
bin/varnishd/cache/cache_acceptor.c
View file @
a3c3e4ef
...
@@ -373,7 +373,7 @@ vca_make_session(struct worker *wrk, void *arg)
...
@@ -373,7 +373,7 @@ vca_make_session(struct worker *wrk, void *arg)
req
=
Req_New
(
wrk
,
sp
);
req
=
Req_New
(
wrk
,
sp
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
req
->
htc
->
fd
=
sp
->
fd
;
req
->
htc
->
rfd
=
&
sp
->
fd
;
SES_SetTransport
(
wrk
,
sp
,
req
,
wa
->
acceptlsock
->
transport
);
SES_SetTransport
(
wrk
,
sp
,
req
,
wa
->
acceptlsock
->
transport
);
}
}
...
...
bin/varnishd/cache/cache_backend.c
View file @
a3c3e4ef
...
@@ -119,7 +119,7 @@ vbe_dir_getfd(struct worker *wrk, struct backend *bp, struct busyobj *bo)
...
@@ -119,7 +119,7 @@ vbe_dir_getfd(struct worker *wrk, struct backend *bp, struct busyobj *bo)
INIT_OBJ
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
INIT_OBJ
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
bo
->
htc
->
priv
=
vc
;
bo
->
htc
->
priv
=
vc
;
bo
->
htc
->
fd
=
vc
->
fd
;
bo
->
htc
->
rfd
=
&
vc
->
fd
;
FIND_TMO
(
first_byte_timeout
,
FIND_TMO
(
first_byte_timeout
,
bo
->
htc
->
first_byte_timeout
,
bo
,
bp
);
bo
->
htc
->
first_byte_timeout
,
bo
,
bp
);
FIND_TMO
(
between_bytes_timeout
,
FIND_TMO
(
between_bytes_timeout
,
...
...
bin/varnishd/cache/cache_panic.c
View file @
a3c3e4ef
...
@@ -183,7 +183,8 @@ pan_htc(struct vsb *vsb, const struct http_conn *htc)
...
@@ -183,7 +183,8 @@ pan_htc(struct vsb *vsb, const struct http_conn *htc)
return
;
return
;
VSB_indent
(
vsb
,
2
);
VSB_indent
(
vsb
,
2
);
PAN_CheckMagic
(
vsb
,
htc
,
HTTP_CONN_MAGIC
);
PAN_CheckMagic
(
vsb
,
htc
,
HTTP_CONN_MAGIC
);
VSB_printf
(
vsb
,
"fd = %d,
\n
"
,
htc
->
fd
);
if
(
htc
->
rfd
!=
NULL
)
VSB_printf
(
vsb
,
"fd = %d (@%p),
\n
"
,
*
htc
->
rfd
,
htc
->
rfd
);
VSB_printf
(
vsb
,
"doclose = %s,
\n
"
,
sess_close_2str
(
htc
->
doclose
,
0
));
VSB_printf
(
vsb
,
"doclose = %s,
\n
"
,
sess_close_2str
(
htc
->
doclose
,
0
));
pan_ws
(
vsb
,
htc
->
ws
);
pan_ws
(
vsb
,
htc
->
ws
);
VSB_printf
(
vsb
,
"{rxbuf_b, rxbuf_e} = {%p, %p},
\n
"
,
VSB_printf
(
vsb
,
"{rxbuf_b, rxbuf_e} = {%p, %p},
\n
"
,
...
...
bin/varnishd/cache/cache_req.c
View file @
a3c3e4ef
...
@@ -68,7 +68,6 @@ Req_New(const struct worker *wrk, struct sess *sp)
...
@@ -68,7 +68,6 @@ Req_New(const struct worker *wrk, struct sess *sp)
req
->
top
=
req
;
// esi overrides
req
->
top
=
req
;
// esi overrides
INIT_OBJ
(
req
->
htc
,
HTTP_CONN_MAGIC
);
INIT_OBJ
(
req
->
htc
,
HTTP_CONN_MAGIC
);
req
->
htc
->
fd
=
-
1
;
e
=
(
char
*
)
req
+
sz
;
e
=
(
char
*
)
req
+
sz
;
p
=
(
char
*
)(
req
+
1
);
p
=
(
char
*
)(
req
+
1
);
...
...
bin/varnishd/cache/cache_session.c
View file @
a3c3e4ef
...
@@ -238,6 +238,8 @@ HTC_RxStuff(struct http_conn *htc, htc_complete_f *func,
...
@@ -238,6 +238,8 @@ HTC_RxStuff(struct http_conn *htc, htc_complete_f *func,
int
i
;
int
i
;
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
AN
(
htc
->
rfd
);
assert
(
*
htc
->
rfd
>
0
);
AN
(
htc
->
ws
->
r
);
AN
(
htc
->
ws
->
r
);
AN
(
htc
->
rxbuf_b
);
AN
(
htc
->
rxbuf_b
);
assert
(
htc
->
rxbuf_b
<=
htc
->
rxbuf_e
);
assert
(
htc
->
rxbuf_b
<=
htc
->
rxbuf_e
);
...
@@ -294,7 +296,7 @@ HTC_RxStuff(struct http_conn *htc, htc_complete_f *func,
...
@@ -294,7 +296,7 @@ HTC_RxStuff(struct http_conn *htc, htc_complete_f *func,
}
}
if
(
tmo
<=
0
.
0
)
if
(
tmo
<=
0
.
0
)
tmo
=
1e-3
;
tmo
=
1e-3
;
i
=
VTCP_read
(
htc
->
fd
,
htc
->
rxbuf_e
,
i
,
tmo
);
i
=
VTCP_read
(
*
htc
->
r
fd
,
htc
->
rxbuf_e
,
i
,
tmo
);
if
(
i
==
0
||
i
==
-
1
)
{
if
(
i
==
0
||
i
==
-
1
)
{
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
return
(
HTC_S_EOF
);
return
(
HTC_S_EOF
);
...
...
bin/varnishd/http1/cache_http1_fetch.c
View file @
a3c3e4ef
...
@@ -88,6 +88,7 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr,
...
@@ -88,6 +88,7 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr,
CHECK_OBJ_ORNULL
(
bo
->
req
,
REQ_MAGIC
);
CHECK_OBJ_ORNULL
(
bo
->
req
,
REQ_MAGIC
);
htc
=
bo
->
htc
;
htc
=
bo
->
htc
;
assert
(
*
htc
->
rfd
>
0
);
hp
=
bo
->
bereq
;
hp
=
bo
->
bereq
;
if
(
bo
->
req
!=
NULL
&&
if
(
bo
->
req
!=
NULL
&&
...
@@ -96,11 +97,11 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr,
...
@@ -96,11 +97,11 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr,
do_chunked
=
1
;
do_chunked
=
1
;
}
}
VTCP_hisname
(
htc
->
fd
,
abuf
,
sizeof
abuf
,
pbuf
,
sizeof
pbuf
);
VTCP_hisname
(
*
htc
->
r
fd
,
abuf
,
sizeof
abuf
,
pbuf
,
sizeof
pbuf
);
VSLb
(
bo
->
vsl
,
SLT_BackendStart
,
"%s %s"
,
abuf
,
pbuf
);
VSLb
(
bo
->
vsl
,
SLT_BackendStart
,
"%s %s"
,
abuf
,
pbuf
);
(
void
)
VTCP_blocking
(
htc
->
fd
);
/* XXX: we should timeout instead */
(
void
)
VTCP_blocking
(
*
htc
->
r
fd
);
/* XXX: we should timeout instead */
V1L_Reserve
(
wrk
,
wrk
->
aws
,
&
htc
->
fd
,
bo
->
vsl
,
bo
->
t_prev
);
V1L_Reserve
(
wrk
,
wrk
->
aws
,
htc
->
r
fd
,
bo
->
vsl
,
bo
->
t_prev
);
*
ctr
+=
HTTP1_Write
(
wrk
,
hp
,
HTTP1_Req
);
*
ctr
+=
HTTP1_Write
(
wrk
,
hp
,
HTTP1_Req
);
/* Deal with any message-body the request might (still) have */
/* Deal with any message-body the request might (still) have */
...
@@ -150,6 +151,7 @@ V1F_FetchRespHdr(struct busyobj *bo)
...
@@ -150,6 +151,7 @@ V1F_FetchRespHdr(struct busyobj *bo)
CHECK_OBJ_ORNULL
(
bo
->
req
,
REQ_MAGIC
);
CHECK_OBJ_ORNULL
(
bo
->
req
,
REQ_MAGIC
);
htc
=
bo
->
htc
;
htc
=
bo
->
htc
;
assert
(
*
htc
->
rfd
>
0
);
VSC_C_main
->
backend_req
++
;
VSC_C_main
->
backend_req
++
;
...
@@ -189,7 +191,7 @@ V1F_FetchRespHdr(struct busyobj *bo)
...
@@ -189,7 +191,7 @@ V1F_FetchRespHdr(struct busyobj *bo)
}
}
return
(
htc
->
rxbuf_e
==
htc
->
rxbuf_b
?
1
:
-
1
);
return
(
htc
->
rxbuf_e
==
htc
->
rxbuf_b
?
1
:
-
1
);
}
}
VTCP_set_read_timeout
(
htc
->
fd
,
htc
->
between_bytes_timeout
);
VTCP_set_read_timeout
(
*
htc
->
r
fd
,
htc
->
between_bytes_timeout
);
hp
=
bo
->
beresp
;
hp
=
bo
->
beresp
;
...
...
bin/varnishd/http1/cache_http1_fsm.c
View file @
a3c3e4ef
...
@@ -130,7 +130,7 @@ http1_unwait(struct worker *wrk, void *arg)
...
@@ -130,7 +130,7 @@ http1_unwait(struct worker *wrk, void *arg)
WS_Release
(
sp
->
ws
,
0
);
WS_Release
(
sp
->
ws
,
0
);
req
=
Req_New
(
wrk
,
sp
);
req
=
Req_New
(
wrk
,
sp
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
req
->
htc
->
fd
=
sp
->
fd
;
req
->
htc
->
rfd
=
&
sp
->
fd
;
HTC_RxInit
(
req
->
htc
,
req
->
ws
);
HTC_RxInit
(
req
->
htc
,
req
->
ws
);
http1_setstate
(
sp
,
H1NEWREQ
);
http1_setstate
(
sp
,
H1NEWREQ
);
wrk
->
task
.
func
=
http1_req
;
wrk
->
task
.
func
=
http1_req
;
...
...
bin/varnishd/http1/cache_http1_vfp.c
View file @
a3c3e4ef
...
@@ -73,7 +73,7 @@ v1f_read(const struct vfp_ctx *vc, struct http_conn *htc, void *d, ssize_t len)
...
@@ -73,7 +73,7 @@ v1f_read(const struct vfp_ctx *vc, struct http_conn *htc, void *d, ssize_t len)
htc
->
pipeline_b
=
htc
->
pipeline_e
=
NULL
;
htc
->
pipeline_b
=
htc
->
pipeline_e
=
NULL
;
}
}
if
(
len
>
0
)
{
if
(
len
>
0
)
{
i
=
read
(
htc
->
fd
,
p
,
len
);
i
=
read
(
*
htc
->
r
fd
,
p
,
len
);
if
(
i
<
0
)
{
if
(
i
<
0
)
{
// XXX: VTCP_Assert(i); // but also: EAGAIN
// XXX: VTCP_Assert(i); // but also: EAGAIN
VSLb
(
vc
->
wrk
->
vsl
,
SLT_FetchError
,
VSLb
(
vc
->
wrk
->
vsl
,
SLT_FetchError
,
...
...
bin/varnishd/http2/cache_http2_proto.c
View file @
a3c3e4ef
...
@@ -136,7 +136,7 @@ h2_new_sess(const struct worker *wrk, struct sess *sp, struct req *srq)
...
@@ -136,7 +136,7 @@ h2_new_sess(const struct worker *wrk, struct sess *sp, struct req *srq)
h2
->
ws
=
srq
->
ws
;
h2
->
ws
=
srq
->
ws
;
h2
->
vsl
=
srq
->
vsl
;
h2
->
vsl
=
srq
->
vsl
;
h2
->
vsl
->
wid
=
sp
->
vxid
;
h2
->
vsl
->
wid
=
sp
->
vxid
;
h2
->
htc
->
fd
=
sp
->
fd
;
h2
->
htc
->
rfd
=
&
sp
->
fd
;
h2
->
sess
=
sp
;
h2
->
sess
=
sp
;
VTAILQ_INIT
(
&
h2
->
streams
);
VTAILQ_INIT
(
&
h2
->
streams
);
#define H2_SETTINGS(n,v,d) \
#define H2_SETTINGS(n,v,d) \
...
@@ -496,7 +496,7 @@ h2_rxframe(struct worker *wrk, struct h2_sess *h2)
...
@@ -496,7 +496,7 @@ h2_rxframe(struct worker *wrk, struct h2_sess *h2)
enum
h2frame
ft
;
enum
h2frame
ft
;
struct
h2_req
*
r2
=
NULL
;
struct
h2_req
*
r2
=
NULL
;
(
void
)
VTCP_blocking
(
h2
->
htc
->
fd
);
(
void
)
VTCP_blocking
(
*
h2
->
htc
->
r
fd
);
h2
->
sess
->
t_idle
=
VTIM_real
();
h2
->
sess
->
t_idle
=
VTIM_real
();
hs
=
HTC_RxStuff
(
h2
->
htc
,
h2_frame_complete
,
hs
=
HTC_RxStuff
(
h2
->
htc
,
h2_frame_complete
,
NULL
,
NULL
,
NAN
,
NULL
,
NULL
,
NAN
,
...
...
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