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
1fca42ed
Commit
1fca42ed
authored
Jul 26, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Remove :version from http2 connection
parent
5ccf647d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
22 deletions
+8
-22
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+2
-5
src/shrpx_spdy_session.cc
src/shrpx_spdy_session.cc
+6
-17
No files found.
src/shrpx_http2_upstream.cc
View file @
1fca42ed
...
...
@@ -720,7 +720,6 @@ int Http2Upstream::error_reply(Downstream *downstream, int status_code)
const
char
*
nv
[]
=
{
":status"
,
http
::
get_status_string
(
status_code
),
":version"
,
"http/1.1"
,
"content-type"
,
"text/html; charset=UTF-8"
,
"server"
,
get_config
()
->
server_name
,
"content-length"
,
content_length
.
c_str
(),
...
...
@@ -784,14 +783,12 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream)
DLOG
(
INFO
,
downstream
)
<<
"HTTP response header completed"
;
}
size_t
nheader
=
downstream
->
get_response_headers
().
size
();
//
6 means :status, :version
and possible via header field.
const
char
**
nv
=
new
const
char
*
[
nheader
*
2
+
6
+
1
];
//
4 means :status
and possible via header field.
const
char
**
nv
=
new
const
char
*
[
nheader
*
2
+
4
+
1
];
size_t
hdidx
=
0
;
std
::
string
via_value
;
nv
[
hdidx
++
]
=
":status"
;
nv
[
hdidx
++
]
=
http
::
get_status_string
(
downstream
->
get_response_http_status
());
nv
[
hdidx
++
]
=
":version"
;
nv
[
hdidx
++
]
=
"HTTP/1.1"
;
for
(
Headers
::
const_iterator
i
=
downstream
->
get_response_headers
().
begin
();
i
!=
downstream
->
get_response_headers
().
end
();
++
i
)
{
if
(
util
::
strieq
((
*
i
).
first
.
c_str
(),
"transfer-encoding"
)
||
...
...
src/shrpx_spdy_session.cc
View file @
1fca42ed
...
...
@@ -745,24 +745,13 @@ void on_frame_recv_callback
break
;
}
auto
nva
=
frame
->
headers
.
nva
;
std
::
string
status
,
version
,
content_length
;
std
::
string
status
,
content_length
;
for
(
size_t
i
=
0
;
i
<
frame
->
headers
.
nvlen
;
++
i
)
{
if
(
util
::
strieq
(
":status"
,
nva
[
i
].
name
,
nva
[
i
].
namelen
))
{
status
.
assign
(
reinterpret_cast
<
char
*>
(
nva
[
i
].
value
),
nva
[
i
].
valuelen
);
auto
code
=
strtoul
(
status
.
c_str
(),
nullptr
,
10
);
downstream
->
set_response_http_status
(
code
);
}
else
if
(
util
::
strieq
(
":version"
,
nva
[
i
].
name
,
nva
[
i
].
namelen
))
{
// We assume for now that most version is HTTP/1.1 from
// SPDY. So just check if it is HTTP/1.0 and then set response
// minor as so.
downstream
->
set_response_major
(
1
);
version
.
assign
(
reinterpret_cast
<
char
*>
(
nva
[
i
].
value
),
nva
[
i
].
valuelen
);
if
(
util
::
strieq
(
"HTTP/1.0"
,
version
.
c_str
()))
{
downstream
->
set_response_minor
(
0
);
}
else
{
downstream
->
set_response_minor
(
1
);
}
}
else
if
(
nva
[
i
].
namelen
>
0
&&
nva
[
i
].
name
[
0
]
!=
':'
)
{
if
(
util
::
strieq
(
"content-length"
,
nva
[
i
].
name
,
nva
[
i
].
namelen
))
{
content_length
.
assign
(
reinterpret_cast
<
char
*>
(
nva
[
i
].
value
),
...
...
@@ -775,11 +764,11 @@ void on_frame_recv_callback
nva
[
i
].
valuelen
));
}
}
if
(
version
.
empty
())
{
// If no version, just assume it is HTTP/1.1
downstream
->
set_response_major
(
1
);
downstream
->
set_response_minor
(
1
);
}
// Just assume it is HTTP/1.1. But we really consider to say 2.0
// here.
downstream
->
set_response_major
(
1
);
downstream
->
set_response_minor
(
1
);
if
(
status
.
empty
())
{
nghttp2_submit_rst_stream
(
session
,
frame
->
hd
.
stream_id
,
NGHTTP2_PROTOCOL_ERROR
);
...
...
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