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
8dc74833
Commit
8dc74833
authored
Aug 17, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite the H1 header fetch without SES_Rx(), this makes it simpler.
parent
f4053ac0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
36 deletions
+10
-36
cache.h
bin/varnishd/cache/cache.h
+0
-1
cache_session.c
bin/varnishd/cache/cache_session.c
+0
-26
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+10
-9
No files found.
bin/varnishd/cache/cache.h
View file @
8dc74833
...
...
@@ -979,7 +979,6 @@ enum htc_status_e {
void
SES_RxInit
(
struct
http_conn
*
htc
,
struct
ws
*
ws
,
unsigned
maxbytes
,
unsigned
maxhdr
);
void
SES_RxReInit
(
struct
http_conn
*
htc
);
enum
htc_status_e
SES_Rx
(
struct
http_conn
*
htc
,
double
tmo
);
enum
htc_status_e
SES_RxStuff
(
struct
http_conn
*
,
htc_complete_f
*
,
double
*
t1
,
double
*
t2
,
double
ti
,
double
tn
);
...
...
bin/varnishd/cache/cache_session.c
View file @
8dc74833
...
...
@@ -189,32 +189,6 @@ SES_RxReInit(struct http_conn *htc)
*
htc
->
rxbuf_e
=
'\0'
;
}
/*--------------------------------------------------------------------
* Receive more HTTP protocol bytes
*/
enum
htc_status_e
SES_Rx
(
struct
http_conn
*
htc
,
double
tmo
)
{
int
i
;
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
AN
(
htc
->
ws
->
r
);
AZ
(
htc
->
pipeline_b
);
AZ
(
htc
->
pipeline_e
);
i
=
(
htc
->
ws
->
r
-
htc
->
rxbuf_e
)
-
1
;
/* space for NUL */
if
(
i
<=
0
)
return
(
HTC_S_OVERFLOW
);
i
=
VTCP_read
(
htc
->
fd
,
htc
->
rxbuf_e
,
i
,
tmo
);
if
(
i
==
-
2
)
return
(
HTC_S_TIMEOUT
);
if
(
i
<=
0
)
return
(
HTC_S_EOF
);
htc
->
rxbuf_e
+=
i
;
*
htc
->
rxbuf_e
=
'\0'
;
return
(
HTC_S_MORE
);
}
/*----------------------------------------------------------------------
* Receive a request/packet/whatever, with timeouts
*
...
...
bin/varnishd/http1/cache_http1_fetch.c
View file @
8dc74833
...
...
@@ -137,7 +137,6 @@ V1F_FetchRespHdr(struct busyobj *bo)
{
struct
http
*
hp
;
enum
htc_status_e
hs
;
int
first
,
i
;
struct
http_conn
*
htc
;
...
...
@@ -160,23 +159,22 @@ V1F_FetchRespHdr(struct busyobj *bo)
first
=
1
;
do
{
hs
=
SES_Rx
(
htc
,
0
);
if
(
hs
==
HTC_S_MORE
)
hs
=
HTTP1_Complete
(
htc
);
if
(
hs
==
HTC_S_OVERFLOW
)
{
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
i
=
(
htc
->
ws
->
r
-
htc
->
rxbuf_e
)
-
1
;
/* space for NUL */
if
(
i
<=
0
)
{
bo
->
acct
.
beresp_hdrbytes
+=
htc
->
rxbuf_e
-
htc
->
rxbuf_b
;
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"http %sread error: overflow"
,
first
?
"first "
:
""
);
htc
->
doclose
=
SC_RX_OVERFLOW
;
return
(
-
1
);
}
i
f
(
hs
==
HTC_S_EOF
)
{
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
i
=
read
(
htc
->
fd
,
htc
->
rxbuf_e
,
i
);
if
(
i
<=
0
)
{
bo
->
acct
.
beresp_hdrbytes
+=
htc
->
rxbuf_e
-
htc
->
rxbuf_b
;
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"http %sread error: EOF"
,
first
?
"first "
:
""
);
htc
->
doclose
=
SC_RX_TIMEOUT
;
...
...
@@ -187,7 +185,10 @@ V1F_FetchRespHdr(struct busyobj *bo)
VTCP_set_read_timeout
(
htc
->
fd
,
htc
->
between_bytes_timeout
);
}
}
while
(
hs
!=
HTC_S_COMPLETE
);
htc
->
rxbuf_e
+=
i
;
*
htc
->
rxbuf_e
=
'\0'
;
}
while
(
HTTP1_Complete
(
htc
)
!=
HTC_S_COMPLETE
);
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_e
);
hp
=
bo
->
beresp
;
...
...
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