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
0929e834
Commit
0929e834
authored
Oct 06, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More backend/http_conn cleanup
parent
9fb31481
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
20 deletions
+18
-20
cache.h
bin/varnishd/cache/cache.h
+1
-2
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+1
-2
cache_http1_fsm.c
bin/varnishd/http1/cache_http1_fsm.c
+2
-3
cache_http1_proto.c
bin/varnishd/http1/cache_http1_proto.c
+2
-3
cache_http1_vfp.c
bin/varnishd/http1/cache_http1_vfp.c
+12
-10
No files found.
bin/varnishd/cache/cache.h
View file @
0929e834
...
...
@@ -244,7 +244,6 @@ struct http_conn {
#define HTTP_CONN_MAGIC 0x3e19edd1
int
fd
;
struct
vsl_log
*
vsl
;
unsigned
maxbytes
;
unsigned
maxhdr
;
struct
ws
*
ws
;
...
...
@@ -915,7 +914,7 @@ enum http1_status_e {
HTTP1_COMPLETE
=
1
};
void
HTTP1_Init
(
struct
http_conn
*
htc
,
struct
ws
*
ws
,
int
fd
,
struct
vsl_log
*
,
void
HTTP1_Init
(
struct
http_conn
*
htc
,
struct
ws
*
ws
,
int
fd
,
unsigned
maxbytes
,
unsigned
maxhdr
);
enum
http1_status_e
HTTP1_Reinit
(
struct
http_conn
*
htc
);
enum
http1_status_e
HTTP1_Rx
(
struct
http_conn
*
htc
);
...
...
bin/varnishd/http1/cache_http1_fetch.c
View file @
0929e834
...
...
@@ -155,8 +155,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
/* Receive response */
HTTP1_Init
(
htc
,
bo
->
ws
,
vc
->
fd
,
bo
->
vsl
,
cache_param
->
http_resp_size
,
HTTP1_Init
(
htc
,
bo
->
ws
,
vc
->
fd
,
cache_param
->
http_resp_size
,
cache_param
->
http_resp_hdr_len
);
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
...
...
bin/varnishd/http1/cache_http1_fsm.c
View file @
0929e834
...
...
@@ -357,9 +357,8 @@ HTTP1_Session(struct worker *wrk, struct req *req)
}
if
(
sp
->
sess_step
==
S_STP_NEWREQ
)
{
HTTP1_Init
(
req
->
htc
,
req
->
ws
,
sp
->
fd
,
req
->
vsl
,
cache_param
->
http_req_size
,
cache_param
->
http_req_hdr_len
);
HTTP1_Init
(
req
->
htc
,
req
->
ws
,
sp
->
fd
,
cache_param
->
http_req_size
,
cache_param
->
http_req_hdr_len
);
}
while
(
1
)
{
...
...
bin/varnishd/http1/cache_http1_proto.c
View file @
0929e834
...
...
@@ -60,14 +60,13 @@ const int HTTP1_Resp[3] = {
/*--------------------------------------------------------------------*/
void
HTTP1_Init
(
struct
http_conn
*
htc
,
struct
ws
*
ws
,
int
fd
,
struct
vsl_log
*
vsl
,
unsigned
max
bytes
,
unsigned
max
hdr
)
HTTP1_Init
(
struct
http_conn
*
htc
,
struct
ws
*
ws
,
int
fd
,
unsigned
maxbytes
,
unsigned
maxhdr
)
{
htc
->
magic
=
HTTP_CONN_MAGIC
;
htc
->
ws
=
ws
;
htc
->
fd
=
fd
;
htc
->
vsl
=
vsl
;
htc
->
maxbytes
=
maxbytes
;
htc
->
maxhdr
=
maxhdr
;
...
...
bin/varnishd/http1/cache_http1_vfp.c
View file @
0929e834
...
...
@@ -46,12 +46,13 @@
*/
static
ssize_t
v1f_read
(
struct
http_conn
*
htc
,
void
*
d
,
size_t
len
)
v1f_read
(
const
struct
vfp_ctx
*
vc
,
struct
http_conn
*
htc
,
void
*
d
,
size_t
len
)
{
ssize_t
l
;
unsigned
char
*
p
;
ssize_t
i
=
0
;
CHECK_OBJ_NOTNULL
(
vc
,
VFP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
l
=
0
;
p
=
d
;
...
...
@@ -71,7 +72,8 @@ v1f_read(struct http_conn *htc, void *d, size_t len)
i
=
read
(
htc
->
fd
,
p
,
len
);
if
(
i
<
0
)
{
// XXX: VTCP_Assert(i); // but also: EAGAIN
VSLb
(
htc
->
vsl
,
SLT_FetchError
,
"%s"
,
strerror
(
errno
));
VSLb
(
vc
->
wrk
->
vsl
,
SLT_FetchError
,
"%s"
,
strerror
(
errno
));
return
(
i
);
}
}
...
...
@@ -110,7 +112,7 @@ v1f_pull_chunked(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
if
(
vfe
->
priv2
==
-
1
)
{
/* Skip leading whitespace */
do
{
lr
=
v1f_read
(
htc
,
buf
,
1
);
lr
=
v1f_read
(
vc
,
htc
,
buf
,
1
);
if
(
lr
<=
0
)
return
(
VFP_Error
(
vc
,
"chunked read err"
));
}
while
(
vct_islws
(
buf
[
0
]));
...
...
@@ -121,7 +123,7 @@ v1f_pull_chunked(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
/* Collect hex digits, skipping leading zeros */
for
(
u
=
1
;
u
<
sizeof
buf
;
u
++
)
{
do
{
lr
=
v1f_read
(
htc
,
buf
+
u
,
1
);
lr
=
v1f_read
(
vc
,
htc
,
buf
+
u
,
1
);
if
(
lr
<=
0
)
return
(
VFP_Error
(
vc
,
"chunked read err"
));
...
...
@@ -135,7 +137,7 @@ v1f_pull_chunked(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
/* Skip trailing white space */
while
(
vct_islws
(
buf
[
u
])
&&
buf
[
u
]
!=
'\n'
)
{
lr
=
v1f_read
(
htc
,
buf
+
u
,
1
);
lr
=
v1f_read
(
vc
,
htc
,
buf
+
u
,
1
);
if
(
lr
<=
0
)
return
(
VFP_Error
(
vc
,
"chunked read err"
));
}
...
...
@@ -157,7 +159,7 @@ v1f_pull_chunked(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
if
(
vfe
->
priv2
>
0
)
{
if
(
vfe
->
priv2
<
l
)
l
=
vfe
->
priv2
;
lr
=
v1f_read
(
htc
,
ptr
,
l
);
lr
=
v1f_read
(
vc
,
htc
,
ptr
,
l
);
if
(
lr
<=
0
)
return
(
VFP_Error
(
vc
,
"straight insufficient bytes"
));
*
lp
=
lr
;
...
...
@@ -167,10 +169,10 @@ v1f_pull_chunked(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
return
(
VFP_OK
);
}
AZ
(
vfe
->
priv2
);
i
=
v1f_read
(
htc
,
buf
,
1
);
i
=
v1f_read
(
vc
,
htc
,
buf
,
1
);
if
(
i
<=
0
)
return
(
VFP_Error
(
vc
,
"chunked read err"
));
if
(
buf
[
0
]
==
'\r'
&&
v1f_read
(
htc
,
buf
,
1
)
<=
0
)
if
(
buf
[
0
]
==
'\r'
&&
v1f_read
(
vc
,
htc
,
buf
,
1
)
<=
0
)
return
(
VFP_Error
(
vc
,
"chunked read err"
));
if
(
buf
[
0
]
!=
'\n'
)
return
(
VFP_Error
(
vc
,
"chunked tail no NL"
));
...
...
@@ -205,7 +207,7 @@ v1f_pull_straight(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
return
(
VFP_END
);
if
(
vfe
->
priv2
<
l
)
l
=
vfe
->
priv2
;
lr
=
v1f_read
(
htc
,
p
,
l
);
lr
=
v1f_read
(
vc
,
htc
,
p
,
l
);
if
(
lr
<=
0
)
return
(
VFP_Error
(
vc
,
"straight insufficient bytes"
));
*
lp
=
lr
;
...
...
@@ -237,7 +239,7 @@ v1f_pull_eof(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p, ssize_t *lp)
l
=
*
lp
;
*
lp
=
0
;
lr
=
v1f_read
(
htc
,
p
,
l
);
lr
=
v1f_read
(
vc
,
htc
,
p
,
l
);
if
(
lr
<
0
)
return
(
VFP_Error
(
vc
,
"eof socket fail"
));
if
(
lr
==
0
)
...
...
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