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
fadbdbae
Commit
fadbdbae
authored
Aug 04, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttp: Add -p option to specify stream priority
parent
2a311b31
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
src/nghttp.cc
src/nghttp.cc
+22
-3
No files found.
src/nghttp.cc
View file @
fadbdbae
...
...
@@ -83,6 +83,7 @@ struct Config {
bool
no_connection_flow_control
;
bool
no_stream_flow_control
;
bool
upgrade
;
int32_t
pri
;
int
multiply
;
// milliseconds
int
timeout
;
...
...
@@ -102,6 +103,7 @@ struct Config {
no_connection_flow_control
(
false
),
no_stream_flow_control
(
false
),
upgrade
(
false
),
pri
(
NGHTTP2_PRI_DEFAULT
),
multiply
(
1
),
timeout
(
-
1
),
window_bits
(
-
1
),
...
...
@@ -895,7 +897,7 @@ void submit_request(HttpClient *client,
}
nv
[
pos
]
=
nullptr
;
int
r
=
nghttp2_submit_request
(
client
->
session
,
NGHTTP2_PRI_DEFAULT
,
int
r
=
nghttp2_submit_request
(
client
->
session
,
config
.
pri
,
nv
.
get
(),
req
->
data_prd
,
req
);
assert
(
r
==
0
);
}
...
...
@@ -1411,7 +1413,8 @@ int run(char **uris, int n)
void
print_usage
(
std
::
ostream
&
out
)
{
out
<<
"Usage: nghttp [-FOafnsuv] [-t <SECONDS>] [-w <WINDOW_BITS>] [--cert=<CERT>]
\n
"
<<
" [--key=<KEY>] [--no-tls] [-d <FILE>] [-m <N>] <URI>..."
<<
" [--key=<KEY>] [--no-tls] [-d <FILE>] [-m <N>] [-p <PRIORITY>]
\n
"
<<
" <URI>..."
<<
std
::
endl
;
}
...
...
@@ -1455,6 +1458,9 @@ void print_help(std::ostream& out)
<<
" option is ignored if --no-tls is not given.
\n
"
<<
" If -d is used, the HTTP upgrade request is
\n
"
<<
" performed with OPTIONS method.
\n
"
<<
" -p, --pri=<PRIORITY>
\n
"
<<
" Sets stream priority. Default: "
<<
NGHTTP2_PRI_DEFAULT
<<
"
\n
"
<<
std
::
endl
;
}
...
...
@@ -1480,10 +1486,11 @@ int main(int argc, char **argv)
{
"no-connection-flow-control"
,
no_argument
,
0
,
'F'
},
{
"no-stream-flow-control"
,
no_argument
,
0
,
'f'
},
{
"upgrade"
,
no_argument
,
0
,
'u'
},
{
"pri"
,
required_argument
,
0
,
'p'
},
{
0
,
0
,
0
,
0
}
};
int
option_index
=
0
;
int
c
=
getopt_long
(
argc
,
argv
,
"FOad:fm:nhH:vst:uw:"
,
long_options
,
int
c
=
getopt_long
(
argc
,
argv
,
"FOad:fm:n
p:
hH:vst:uw:"
,
long_options
,
&
option_index
);
if
(
c
==
-
1
)
{
break
;
...
...
@@ -1504,6 +1511,18 @@ int main(int argc, char **argv)
case
'n'
:
config
.
null_out
=
true
;
break
;
case
'p'
:
{
auto
n
=
strtoul
(
optarg
,
nullptr
,
10
);
if
(
n
<=
NGHTTP2_PRI_LOWEST
)
{
config
.
pri
=
n
;
}
else
{
std
::
cerr
<<
"-p: specify the integer in the range [0, "
<<
NGHTTP2_PRI_LOWEST
<<
"], inclusive"
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
break
;
}
case
'v'
:
config
.
verbose
=
true
;
break
;
...
...
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