Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
34581d83
Commit
34581d83
authored
Mar 30, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID
This identifier string is used if HTTP/2 is used over cleartext TCP.
parent
33465804
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
6 deletions
+25
-6
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+18
-1
src/nghttp.cc
src/nghttp.cc
+1
-1
src/shrpx_client_handler.cc
src/shrpx_client_handler.cc
+1
-1
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+5
-3
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
34581d83
...
...
@@ -38,7 +38,8 @@ extern "C" {
/**
* @macro
*
* The protocol version identification of this library supports.
* The protocol version identification string of this library
* supports. This identifier is used if HTTP/2 is used over TLS.
*/
#define NGHTTP2_PROTO_VERSION_ID "h2-10"
/**
...
...
@@ -48,6 +49,22 @@ extern "C" {
*/
#define NGHTTP2_PROTO_VERSION_ID_LEN 5
/**
* @macro
*
* The protocol version identification string of this library
* supports. This identifier is used if HTTP/2 is used over cleartext
* TCP.
*/
#define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID "h2c-10"
/**
* @macro
*
* The length of :macro:`NGHTTP2_CLEARTEXT_PROTO_VERSION_ID`.
*/
#define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN 6
struct
nghttp2_session
;
/**
* @struct
...
...
src/nghttp.cc
View file @
34581d83
...
...
@@ -611,7 +611,7 @@ struct HttpClient {
req
+=
hostport
;
req
+=
"
\r\n
"
"Connection: Upgrade, HTTP2-Settings
\r\n
"
"Upgrade: "
NGHTTP2_PROTO_VERSION_ID
"
\r\n
"
"Upgrade: "
NGHTTP2_
CLEARTEXT_
PROTO_VERSION_ID
"
\r\n
"
"HTTP2-Settings: "
;
req
+=
token68
;
req
+=
"
\r\n
"
...
...
src/shrpx_client_handler.cc
View file @
34581d83
...
...
@@ -542,7 +542,7 @@ int ClientHandler::perform_http2_upgrade(HttpsUpstream *http)
set_bev_cb
(
upstream_http2_connhd_readcb
,
upstream_writecb
,
upstream_eventcb
);
static
char
res
[]
=
"HTTP/1.1 101 Switching Protocols
\r\n
"
"Connection: Upgrade
\r\n
"
"Upgrade: "
NGHTTP2_PROTO_VERSION_ID
"
\r\n
"
"Upgrade: "
NGHTTP2_
CLEARTEXT_
PROTO_VERSION_ID
"
\r\n
"
"
\r\n
"
;
rv
=
bufferevent_write
(
bev_
,
res
,
sizeof
(
res
)
-
1
);
if
(
rv
!=
0
)
{
...
...
src/shrpx_downstream.cc
View file @
34581d83
...
...
@@ -734,10 +734,12 @@ bool Downstream::http2_upgrade_request() const
bool
upgrade_seen
=
false
;
bool
http2_settings_seen
=
false
;
for
(
auto
&
hd
:
request_headers_
)
{
// For now just check NGHTTP2_PROTO_VERSION_ID in Upgrade header
// field and existence of HTTP2-Settings header field.
// For now just check NGHTTP2_CLEARTEXT_PROTO_VERSION_ID in
// Upgrade header field and existence of HTTP2-Settings header
// field.
if
(
util
::
strieq
(
hd
.
first
.
c_str
(),
"upgrade"
))
{
if
(
util
::
strieq
(
hd
.
second
.
c_str
(),
NGHTTP2_PROTO_VERSION_ID
))
{
if
(
util
::
strieq
(
hd
.
second
.
c_str
(),
NGHTTP2_CLEARTEXT_PROTO_VERSION_ID
))
{
upgrade_seen
=
true
;
}
}
else
if
(
util
::
strieq
(
hd
.
first
.
c_str
(),
"http2-settings"
))
{
...
...
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