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
7ded6385
Commit
7ded6385
authored
Sep 21, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Insert an artificial pause in the H2 preface, at the point where it
makes a valid H1 request header.
parent
d8cf732d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
vtc_http.c
bin/varnishtest/vtc_http.c
+14
-7
No files found.
bin/varnishtest/vtc_http.c
View file @
7ded6385
...
...
@@ -1678,7 +1678,7 @@ cmd_http_fatal(CMD_ARGS)
* Same as for the top-level barrier
*/
const
char
PREFACE
[]
=
"PRI * HTTP/2.0
\r\n\r\n
SM
\r\n\r\n
"
;
const
char
PREFACE
[
24
]
=
"PRI * HTTP/2.0
\r\n\r\n
SM
\r\n\r\n
"
;
/* SECTION: client-server.spec.txpri txpri (client)
*
...
...
@@ -1694,11 +1694,18 @@ cmd_http_txpri(CMD_ARGS)
CAST_OBJ_NOTNULL
(
hp
,
priv
,
HTTP_MAGIC
);
ONLY_CLIENT
(
hp
,
av
);
vtc_dump
(
hp
->
vl
,
4
,
"txpri"
,
PREFACE
,
sizeof
(
PREFACE
)
-
1
);
l
=
write
(
hp
->
fd
,
PREFACE
,
sizeof
(
PREFACE
)
-
1
);
if
(
l
!=
sizeof
(
PREFACE
)
-
1
)
vtc_dump
(
hp
->
vl
,
4
,
"txpri"
,
PREFACE
,
sizeof
(
PREFACE
));
/* Dribble out the preface */
l
=
write
(
hp
->
fd
,
PREFACE
,
18
);
if
(
l
!=
18
)
vtc_log
(
vl
,
hp
->
fatal
,
"Write failed: (%zd vs %zd) %s"
,
l
,
sizeof
(
PREFACE
)
-
1
,
strerror
(
errno
));
l
,
sizeof
(
PREFACE
),
strerror
(
errno
));
usleep
(
10000
);
l
=
write
(
hp
->
fd
,
PREFACE
+
18
,
sizeof
(
PREFACE
)
-
18
);
if
(
l
!=
sizeof
(
PREFACE
)
-
18
)
vtc_log
(
vl
,
hp
->
fatal
,
"Write failed: (%zd vs %zd) %s"
,
l
,
sizeof
(
PREFACE
),
strerror
(
errno
));
start_h2
(
hp
);
AN
(
hp
->
h2
);
}
...
...
@@ -1717,9 +1724,9 @@ cmd_http_rxpri(CMD_ARGS)
ONLY_SERVER
(
hp
,
av
);
hp
->
prxbuf
=
0
;
if
(
!
http_rxchar
(
hp
,
sizeof
(
PREFACE
)
-
1
,
0
))
if
(
!
http_rxchar
(
hp
,
sizeof
(
PREFACE
),
0
))
vtc_log
(
vl
,
0
,
"Couldn't retrieve connection preface"
);
if
(
strncmp
(
hp
->
rxbuf
,
PREFACE
,
sizeof
(
PREFACE
)
-
1
))
if
(
memcmp
(
hp
->
rxbuf
,
PREFACE
,
sizeof
(
PREFACE
)
))
vtc_log
(
vl
,
0
,
"Received invalid preface
\n
"
);
start_h2
(
hp
);
AN
(
hp
->
h2
);
...
...
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