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
9b424536
Commit
9b424536
authored
Feb 07, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shrpx: Refactor spdy downstream header field handling
parent
c7071258
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
src/shrpx_spdy_downstream_connection.cc
src/shrpx_spdy_downstream_connection.cc
+23
-15
No files found.
src/shrpx_spdy_downstream_connection.cc
View file @
9b424536
...
...
@@ -195,7 +195,11 @@ int SpdyDownstreamConnection::push_request_headers()
std
::
string
via_value
;
std
::
string
xff_value
;
std
::
string
scheme
,
path
,
query
;
if
(
downstream_
->
get_request_method
()
!=
"CONNECT"
)
{
if
(
downstream_
->
get_request_method
()
==
"CONNECT"
)
{
// No :scheme header field for CONNECT method.
nv
[
hdidx
++
]
=
":path"
;
nv
[
hdidx
++
]
=
downstream_
->
get_request_path
().
c_str
();
}
else
{
http_parser_url
u
;
const
char
*
url
=
downstream_
->
get_request_path
().
c_str
();
memset
(
&
u
,
0
,
sizeof
(
u
));
...
...
@@ -206,29 +210,33 @@ int SpdyDownstreamConnection::push_request_headers()
copy_url_component
(
scheme
,
&
u
,
UF_SCHEMA
,
url
);
copy_url_component
(
path
,
&
u
,
UF_PATH
,
url
);
copy_url_component
(
query
,
&
u
,
UF_QUERY
,
url
);
if
(
path
.
empty
())
{
path
=
"/"
;
}
if
(
!
query
.
empty
())
{
path
+=
"?"
;
path
+=
query
;
}
}
nv
[
hdidx
++
]
=
":scheme"
;
if
(
scheme
.
empty
())
{
// The default scheme is http. For SPDY upstream, the path must
// be absolute URI, so scheme should be provided.
nv
[
hdidx
++
]
=
"http"
;
}
else
{
nv
[
hdidx
++
]
=
scheme
.
c_str
();
}
nv
[
hdidx
++
]
=
":path"
;
if
(
path
.
empty
())
{
nv
[
hdidx
++
]
=
downstream_
->
get_request_path
().
c_str
();
}
else
{
nv
[
hdidx
++
]
=
path
.
c_str
();
}
}
nv
[
hdidx
++
]
=
":method"
;
nv
[
hdidx
++
]
=
downstream_
->
get_request_method
().
c_str
();
nv
[
hdidx
++
]
=
":scheme"
;
if
(
scheme
.
empty
())
{
// Currently, the user of this downstream connecion is HTTP
// only.
nv
[
hdidx
++
]
=
"http"
;
}
else
{
nv
[
hdidx
++
]
=
scheme
.
c_str
();
}
nv
[
hdidx
++
]
=
":path"
;
if
(
downstream_
->
get_request_method
()
==
"CONNECT"
||
path
.
empty
())
{
nv
[
hdidx
++
]
=
downstream_
->
get_request_path
().
c_str
();
}
else
{
nv
[
hdidx
++
]
=
path
.
c_str
();
}
nv
[
hdidx
++
]
=
":version"
;
nv
[
hdidx
++
]
=
"HTTP/1.1"
;
bool
chunked_encoding
=
false
;
...
...
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